Commit b6806742

mo k <mo@mokhan.ca>
2012-06-09 03:23:33
fix bug where the settings page could not be updated because of mass assignment issue.
1 parent 0f85187
Changed files (1)
app
models
app/models/user.rb
@@ -12,12 +12,13 @@ class User < ActiveRecord::Base
   validates :name,  :presence => true
   validates :website, :format => URI::regexp(%w(http https)), :allow_blank => true
   #validates_with UrlValidation
-  has_many :authentications
-  has_and_belongs_to_many :interests, :join_table => 'users_interests', :uniq => true, :autosave => true
   devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable
-  attr_accessible :name, :email, :website, :twitter, :facebook, :city, :latitude, :longitude, :password, :password_confirmation, :remember_me
+  attr_accessor :password, :password_confirmation, :current_password
+  attr_accessible :name, :email, :website, :twitter, :facebook, :city, :latitude, :longitude, :password, :password_confirmation, :current_password, :remember_me, :interest_ids
   has_many :creations, :dependent => :destroy
   has_many :favorites, :dependent => :destroy
+  has_many :authentications
+  has_and_belongs_to_many :interests, :join_table => 'users_interests', :uniq => true, :autosave => true
 
   def add_favorite( creation )
     if self.already_likes(creation)