instance method assign_multiparameter_attributes

Ruby on Rails 3.2.22.5

Since v3.2.22.5 Private

Available in: v3.2.22.5 v4.0.13 v4.1.16 v4.2.9 v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

assign_multiparameter_attributes(pairs)

Instantiates objects for all attribute classes that needs more than one constructor parameter. This is done by calling new on the column type or aggregation type (through composed_of) object with these parameters. So having the pairs written_on(1) = “2004”, written_on(2) = “6”, written_on(3) = “24”, will instantiate written_on (a date type) with Date.new(“2004”, “6”, “24”). You can also specify a typecast character in the parentheses to have the parameters typecasted before they’re used in the constructor. Use i for Fixnum, f for Float, s for String, and a for Array. If all the values for a given attribute are empty, the attribute will be set to nil.

Parameters

pairs req
Source
# File activerecord/lib/active_record/attribute_assignment.rb, line 120
    def assign_multiparameter_attributes(pairs)
      execute_callstack_for_multiparameter_attributes(
        extract_callstack_for_multiparameter_attributes(pairs)
      )
    end

Defined in activerecord/lib/active_record/attribute_assignment.rb line 120 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::AttributeAssignment

Type at least 2 characters to search.

↑↓ navigate · open · esc close