Use render instead of redirect if registration/create fails
This commit is contained in:
parent
243f33ff91
commit
bae0be338a
5 changed files with 53 additions and 42 deletions
|
|
@ -1,7 +1,13 @@
|
|||
class SupporterRegistration < ActiveRecord::Base
|
||||
belongs_to :supporter_level
|
||||
belongs_to :registration
|
||||
before_save :set_attributes_from_person
|
||||
|
||||
attr_accessible :registration, :supporter_level_id, :name, :email, :supporter_level, :code, :code_is_valid, :conference_id
|
||||
|
||||
def set_attributes_from_person
|
||||
self.name ||= registration.try(:person).try(:public_name)
|
||||
self.email ||= registration.try(:person).try(:email)
|
||||
true
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue