Skip to content

Instantly share code, notes, and snippets.

@simi
Created April 15, 2011 11:02
Show Gist options
  • Select an option

  • Save simi/921524 to your computer and use it in GitHub Desktop.

Select an option

Save simi/921524 to your computer and use it in GitHub Desktop.
ruby-1.8.7-p302 > class Banan < ActiveRecord::Base
ruby-1.8.7-p302 ?> set_table_name "clientzone_users"
ruby-1.8.7-p302 ?> attr_accessible :email
ruby-1.8.7-p302 ?> end
=> #<ActiveModel::MassAssignmentSecurity::WhiteList: {"email"}>
ruby-1.8.7-p302 >
ruby-1.8.7-p302 > class Banan2 < ActiveRecord::Base
ruby-1.8.7-p302 ?> set_table_name "clientzone_users"
ruby-1.8.7-p302 ?> end
=> #<Proc:0x00007f7e12cb3558@/home/retro/.rvm/gems/ruby-1.8.7-p302@www.respect-fashion.cz/gems/activemodel-3.0.7.rc1/lib/active_model/attribute_methods.rb:110>
ruby-1.8.7-p302 > Banan.new(:email => 'A')
=> #<Banan id: nil, name: nil, telephone: nil, zone_type: nil, email: "A", encrypted_password: "", reset_password_token: nil, created_at: nil, updated_at: nil>
ruby-1.8.7-p302 > Banan2.new(:email => 'A')
=> #<Banan2 id: nil, name: nil, telephone: nil, zone_type: nil, email: "", encrypted_password: "", reset_password_token: nil, created_at: nil, updated_at: nil>
ruby-1.8.7-p302 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment