Merge pull request #615 from hennevogel/master

Implements sign up during registration. Solves most of #215
This commit is contained in:
Henne Vogelsang 2015-03-26 14:30:14 +01:00
commit defef46ae8
14 changed files with 113 additions and 117 deletions

View file

@ -121,6 +121,10 @@ class Ability
can :show, Commercial, commercialable_type: 'Event', commercialable_id: Event.where(state: 'confirmed').pluck(:id)
# can view others
can :show, User
# can register
can [:read, :create], Registration do |registration|
registration.new_record?
end
end
def signed_in(user)

View file

@ -1,5 +1,7 @@
class Registration < ActiveRecord::Base
belongs_to :user
validates :user, presence: true
accepts_nested_attributes_for :user
belongs_to :conference
belongs_to :dietary_choice