Merge branch 'master' into ticket-currency-bug
This commit is contained in:
commit
bf896a136a
28 changed files with 359 additions and 82 deletions
|
|
@ -66,7 +66,13 @@ class Ability
|
|||
|
||||
can [:new, :create], Registration do |registration|
|
||||
conference = registration.conference
|
||||
conference.registration_open? && !conference.registration_limit_exceeded? || conference.program.speakers.confirmed.include?(user)
|
||||
if conference.user_registered? user
|
||||
false
|
||||
elsif conference.program.speakers.confirmed.include?(user) && conference.registration_period
|
||||
true
|
||||
else
|
||||
conference.registration_open? && !conference.registration_limit_exceeded?
|
||||
end
|
||||
end
|
||||
|
||||
can :index, Organization
|
||||
|
|
|
|||
|
|
@ -1029,7 +1029,7 @@ class Conference < ApplicationRecord
|
|||
# * +hash+ -> object_type => {color, value}
|
||||
def calculate_event_distribution(group_by_id, association_symbol, state = nil)
|
||||
grouped = if state
|
||||
program.events.select(group_by_id).where('state = ?', 'confirmed').group(group_by_id)
|
||||
program.events.select(group_by_id).where('state = ?', state).group(group_by_id)
|
||||
else
|
||||
program.events.select(group_by_id).group(group_by_id)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,7 +7,11 @@ class Organization < ApplicationRecord
|
|||
|
||||
after_create :create_roles
|
||||
|
||||
validates :name, presence: true
|
||||
validates :name,
|
||||
uniqueness: {
|
||||
case_sensitive: false
|
||||
},
|
||||
presence: true
|
||||
|
||||
mount_uploader :picture, PictureUploader, mount_on: :picture
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
class Registration < ApplicationRecord
|
||||
require 'csv'
|
||||
belongs_to :user
|
||||
belongs_to :conference
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue