Merge branch 'master' into user_openid_management

This commit is contained in:
Stella Rouzi 2017-06-13 10:25:08 +03:00 committed by GitHub
commit 2e922650a7
22 changed files with 426 additions and 30 deletions

View file

@ -83,6 +83,7 @@ class Ability
conference.registration_open? && !conference.registration_limit_exceeded? || conference.program.speakers.confirmed.include?(user)
end
can :index, Organization
can :index, Ticket
can :manage, TicketPurchase, user_id: user.id
can [:new, :create], Payment, user_id: user.id

View file

@ -7,6 +7,8 @@ class Conference < ActiveRecord::Base
default_scope { order('start_date DESC') }
belongs_to :organization
has_paper_trail ignore: %i(updated_at guid revision events_per_week), meta: { conference_id: :id }
has_and_belongs_to_many :questions
@ -53,7 +55,8 @@ class Conference < ActiveRecord::Base
:start_date,
:end_date,
:start_hour,
:end_hour, presence: true
:end_hour,
:organization, presence: true
validates :short_title, uniqueness: true
validates :short_title, format: { with: /\A[a-zA-Z0-9_-]*\z/ }

View file

@ -0,0 +1,7 @@
class Organization < ActiveRecord::Base
has_many :conferences, dependent: :destroy
validates :name, presence: true
mount_uploader :picture, PictureUploader, mount_on: :picture
end