Files

Class Index [+]

Quicksearch

ActiveRecord::AttributeMethods::BeforeTypeCast

Public Instance Methods

attributes_before_type_cast() click to toggle source

Returns a hash of attributes before typecasting and deserialization.

    # File lib/active_record/attribute_methods/before_type_cast.rb, line 15
15:       def attributes_before_type_cast
16:         self.attribute_names.inject({}) do |attrs, name|
17:           attrs[name] = read_attribute_before_type_cast(name)
18:           attrs
19:         end
20:       end
read_attribute_before_type_cast(attr_name) click to toggle source
    # File lib/active_record/attribute_methods/before_type_cast.rb, line 10
10:       def read_attribute_before_type_cast(attr_name)
11:         @attributes[attr_name]
12:       end

Private Instance Methods

attribute_before_type_cast(attribute_name) click to toggle source

Handle *_before_type_cast for method_missing.

    # File lib/active_record/attribute_methods/before_type_cast.rb, line 24
24:         def attribute_before_type_cast(attribute_name)
25:           if attribute_name == 'id'
26:             read_attribute_before_type_cast(self.class.primary_key)
27:           else
28:             read_attribute_before_type_cast(attribute_name)
29:           end
30:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.