Skip to content

Commit

Permalink
Make User#state mass-assignable. Can we maybe just remove the attr_ac…
Browse files Browse the repository at this point in the history
…cessible? [#41]
  • Loading branch information
marnen committed Oct 20, 2009
1 parent edd1bc7 commit d25469a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/user.rb
Expand Up @@ -26,7 +26,7 @@ class User < ActiveRecord::Base
after_create :set_calendar
# prevents a user from submitting a crafted form that bypasses activation
# anything else you want your user to change should be added here.
attr_accessible :email, :password, :password_confirmation, :firstname, :lastname, :street, :street2, :city, :state_id, :zip, :show_contact
attr_accessible :email, :password, :password_confirmation, :firstname, :lastname, :street, :street2, :city, :state, :state_id, :zip, :show_contact

# Sets the User's active status to true.
# TODO: Rename to activate! , since it's destructive.
Expand Down
2 changes: 1 addition & 1 deletion spec/models/user_spec.rb
Expand Up @@ -36,7 +36,7 @@
aggr.options[:mapping].should == [%w(street street), %w(street2 street2), %w(city city), %w(state_id state), %w(zip zip), %w(coords coords)]
state = State.make(:code => 'NY', :country => Country.make(:code => 'US'))
opts = {:street => '123 Main Street', :street2 => '1st floor', :city => 'Anytown', :zip => 12345, :state => state}
u = User.make(opts)
u = User.new(opts)
u.address.should == Address.new(opts)
end

Expand Down

0 comments on commit d25469a

Please sign in to comment.