diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2012-09-18 21:03:26 -0500 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2012-09-18 21:22:55 -0500 |
commit | c9f339ef4a2609bd1b29ad967ab1f123cadb0758 (patch) | |
tree | e399d82a06b68d4a4aff63e9e3ed34e4953e1b1a | |
parent | 2dff5dc5cbcefcb3d8f8e73d1f6a2c2f0cdbf711 (diff) | |
download | rails-c9f339ef4a2609bd1b29ad967ab1f123cadb0758.tar.gz rails-c9f339ef4a2609bd1b29ad967ab1f123cadb0758.tar.bz2 rails-c9f339ef4a2609bd1b29ad967ab1f123cadb0758.zip |
Update docs for AR::Base#new to remove references to mass_assignment_options
-rw-r--r-- | activerecord/lib/active_record/core.rb | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index 8f798830d4..f97c363871 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -160,18 +160,9 @@ module ActiveRecord # In both instances, valid attribute keys are determined by the column names of the associated table -- # hence you can't have attributes that aren't part of the table columns. # - # +initialize+ respects mass-assignment security and accepts either +:as+ or +:without_protection+ options - # in the +options+ parameter. - # - # ==== Examples + # ==== Example: # # Instantiates a single new object # User.new(:first_name => 'Jamie') - # - # # Instantiates a single new object using the :admin mass-assignment security role - # User.new({ :first_name => 'Jamie', :is_admin => true }, :as => :admin) - # - # # Instantiates a single new object bypassing mass-assignment security - # User.new({ :first_name => 'Jamie', :is_admin => true }, :without_protection => true) def initialize(attributes = nil) defaults = self.class.column_defaults.dup defaults.each { |k, v| defaults[k] = v.dup if v.duplicable? } |