Move common views to partial

This commit is contained in:
Stella Rouzi 2015-04-18 21:44:40 +03:00
parent b15c1abd2e
commit 969c24c091
16 changed files with 101 additions and 120 deletions

View file

@ -1,7 +1,5 @@
class Registration < ActiveRecord::Base
belongs_to :user
validates :user, presence: true
accepts_nested_attributes_for :user
belongs_to :conference
belongs_to :dietary_choice
@ -29,6 +27,8 @@ class Registration < ActiveRecord::Base
alias_attribute :other_needs, :other_special_needs
validates :user, presence: true
validates_uniqueness_of :user_id, scope: :conference_id, message: 'already Registered!'
after_create :set_week, :subscribe_to_conference, :send_registration_mail