Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update docs for AR::Base#new to remove references to mass_assignment_…

…options
  • Loading branch information...
commit c9f339ef4a2609bd1b29ad967ab1f123cadb0758 1 parent 2dff5dc
@guilleiguaran guilleiguaran authored
Showing with 1 addition and 10 deletions.
  1. +1 −10 activerecord/lib/active_record/core.rb
View
11 activerecord/lib/active_record/core.rb
@@ -160,18 +160,9 @@ def relation #:nodoc:
# 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? }
Please sign in to comment.
Something went wrong with that request. Please try again.