Merge pull request #42 from Randuin/issue-35

issue 35 fix, just a model limiting mass assignment
This commit is contained in:
r888888888
2011-09-11 11:19:25 -07:00

View File

@@ -14,7 +14,7 @@ class User < ActiveRecord::Base
end
attr_accessor :password, :old_password
attr_accessible :password, :old_password, :password_confirmation, :password_hash, :email, :last_logged_in_at, :last_forum_read_at, :has_mail, :receive_email_notifications, :comment_threshold, :always_resize_images, :favorite_tags, :blacklisted_tags, :name, :ip_addr
attr_accessible :password, :old_password, :password_confirmation, :password_hash, :email, :last_logged_in_at, :last_forum_read_at, :has_mail, :receive_email_notifications, :comment_threshold, :always_resize_images, :favorite_tags, :blacklisted_tags, :name, :ip_addr, :time_zone
validates_length_of :name, :within => 2..20, :on => :create
validates_format_of :name, :with => /\A[^\s:]+\Z/, :on => :create, :message => "cannot have whitespace or colons"
validates_uniqueness_of :name, :case_sensitive => false, :on => :create