##// END OF EJS Templates
Rails3: replace deprecated 'before_create' method at User model....
Toshi MARUYAMA -
r6723:17ec2a289f93
parent child
Show More
@@ -73,6 +73,7 class User < Principal
73 73 validates_confirmation_of :password, :allow_nil => true
74 74 validates_inclusion_of :mail_notification, :in => MAIL_NOTIFICATION_OPTIONS.collect(&:first), :allow_blank => true
75 75
76 before_create :set_mail_notification
76 77 before_destroy :remove_references_before_destroy
77 78
78 79 named_scope :in_group, lambda {|group|
@@ -84,7 +85,7 class User < Principal
84 85 { :conditions => ["#{User.table_name}.id NOT IN (SELECT gu.user_id FROM #{table_name_prefix}groups_users#{table_name_suffix} gu WHERE gu.group_id = ?)", group_id] }
85 86 }
86 87
87 def before_create
88 def set_mail_notification
88 89 self.mail_notification = Setting.default_notification_option if self.mail_notification.blank?
89 90 true
90 91 end
General Comments 0
You need to be logged in to leave comments. Login now