Class: Protobuf::ActiveRecord::Serialization::ClassMethods::CollectionAssociationCaller
- Inherits:
-
Object
- Object
- Protobuf::ActiveRecord::Serialization::ClassMethods::CollectionAssociationCaller
- Defined in:
- lib/protobuf/active_record/serialization.rb
Instance Method Summary collapse
- #call(selph) ⇒ Object
-
#initialize(method_name) ⇒ CollectionAssociationCaller
constructor
A new instance of CollectionAssociationCaller.
Constructor Details
#initialize(method_name) ⇒ CollectionAssociationCaller
147 148 149 |
# File 'lib/protobuf/active_record/serialization.rb', line 147 def initialize(method_name) @method_name = method_name end |
Instance Method Details
#call(selph) ⇒ Object
151 152 153 154 155 |
# File 'lib/protobuf/active_record/serialization.rb', line 151 def call(selph) selph.__send__(@method_name).to_a rescue NameError # Has happened when field is not on model or ignored from db return nil end |