Minor changes

This commit is contained in:
Rishabh Singh 2019-07-23 01:39:48 +05:30
parent 58208c73ac
commit 6a8aca6095
5 changed files with 29 additions and 29 deletions

View file

@ -657,4 +657,4 @@ linters:
# Offense count: 38
InlineStyles:
enabled: false
enabled: false

View file

@ -155,17 +155,20 @@ class Ability
can :manage, Registration, conference_id: conf_ids_for_organizer
# To access conference/proposals
can :manage, Event, program: { conference_id: conf_ids_for_organizer }
can :manage, Comment
# To access comment link in menu bar
# can :index, Comment, commentable_type: 'Event',
# commentable_id: Event.where(program_id: Program.where(conference_id: conf_ids_for_organizer).pluck(:id)).pluck(:id)
can :index, Comment, commentable_type: 'Event',
commentable_id: Event.where(program_id: Program.where(conference_id: conf_ids_for_organizer).pluck(:id)).pluck(:id)
can :index, Comment, commentable_type: 'Track',
commentable_id: Track.where(program_id: Program.where(conference_id: conf_ids_for_organizer).pluck(:id)).pluck(:id)
end
if conf_ids_for_cfp
# To access comment link in menu bar
can :manage, Comment
# can :index, Comment, commentable_type: 'Event',
# commentable_id: Event.where(program_id: Program.where(conference_id: conf_ids_for_cfp).pluck(:id)).pluck(:id)
can :index, Comment, commentable_type: 'Event',
commentable_id: Event.where(program_id: Program.where(conference_id: conf_ids_for_cfp).pluck(:id)).pluck(:id)
can :index, Comment, commentable_type: 'Track',
commentable_id: Track.where(program_id: Program.where(conference_id: conf_ids_for_organizer).pluck(:id)).pluck(:id)
# To access conference/proposals
can :manage, Event, program: { conference_id: conf_ids_for_cfp }
end

View file

@ -193,7 +193,7 @@ class AdminAbility
commentable_id: Event.where(program_id: Program.where(conference_id: conf_ids_for_cfp).pluck(:id)).pluck(:id)
can :index, Comment, commentable_type: 'Track',
commentable_id: Track.where(program_id: Program.where(conference_id: conf_ids).pluck(:id)).pluck(:id)
commentable_id: Track.where(program_id: Program.where(conference_id: conf_ids_for_cfp).pluck(:id)).pluck(:id)
# Abilities for Role (Conference resource)
can [:index, :show], Role do |role|
role.resource_type == 'Conference' || role.resource_type == 'Track'

View file

@ -1,25 +1,32 @@
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
<%
encoding = 'unicode'
if ENV['OSEM_DB_ADAPTER'] == 'mysql2'
encoding = 'utf8'
end
%>
default: &default
adapter: sqlite3
adapter: <%= ENV['OSEM_DB_ADAPTER'] || 'postgresql' %>
encoding: <%= encoding %>
host: <%= ENV['OSEM_DB_HOST'] || 'database' %>
port: <%= ENV['OSEM_DB_PORT'] || '5432' %>
username: <%= ENV['OSEM_DB_USER'] || 'postgres' %>
password: <%= ENV['OSEM_DB_PASSWORD'] || 'mysecretpassword' %>
database: <%= ENV['OSEM_DB_NAME'] || 'postgres' %>
pool: 5
timeout: 5000
development:
<<: *default
database: db/development.sqlite3
database: osem_development
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# re-generated when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: db/test.sqlite3
database: osem_test
production:
<<: *default
database: db/production.sqlite3

View file

@ -10,11 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
<<<<<<< HEAD
ActiveRecord::Schema.define(version: 2019_06_03_143107) do
=======
ActiveRecord::Schema.define(version: 20190720062321) do
>>>>>>> Add comment functionality to tracks
create_table "answers", force: :cascade do |t|
t.string "title"
@ -553,10 +549,7 @@ ActiveRecord::Schema.define(version: 20190720062321) do
t.date "end_date"
t.text "relevance"
t.integer "selected_schedule_id"
<<<<<<< HEAD
=======
t.integer "comments_count", default: 0, null: false
>>>>>>> Add comment functionality to tracks
t.index ["room_id"], name: "index_tracks_on_room_id"
t.index ["selected_schedule_id"], name: "index_tracks_on_selected_schedule_id"
t.index ["submitter_id"], name: "index_tracks_on_submitter_id"
@ -595,7 +588,6 @@ ActiveRecord::Schema.define(version: 20190720062321) do
t.boolean "is_admin", default: false
t.string "username"
t.boolean "is_disabled", default: false
<<<<<<< HEAD
t.string "invitation_token"
t.datetime "invitation_created_at"
t.datetime "invitation_sent_at"
@ -604,8 +596,6 @@ ActiveRecord::Schema.define(version: 20190720062321) do
t.string "invited_by_type"
t.integer "invited_by_id"
t.integer "invitations_count", default: 0
=======
>>>>>>> Add comment functionality to tracks
t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["invitation_token"], name: "index_users_on_invitation_token", unique: true