Class: ActiveInteraction::Extras::ModelFields::Context

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/active_interaction/extras/model_fields.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#from_model_nameObject

Returns the value of attribute from_model_name.



25
26
27
# File 'lib/active_interaction/extras/model_fields.rb', line 25

def from_model_name
  @from_model_name
end

#model_field_cacheObject

Returns the value of attribute model_field_cache.



26
27
28
# File 'lib/active_interaction/extras/model_fields.rb', line 26

def model_field_cache
  @model_field_cache
end

Instance Method Details

#custom_filter_attribute(name, opts = {}) ⇒ Object Also known as: interface, date, time, date_time, integer, decimal, float, string, symbol, object, hash, file, boolean, array



28
29
30
31
32
33
# File 'lib/active_interaction/extras/model_fields.rb', line 28

def custom_filter_attribute(name, opts = {})
  from_model_name = self.from_model_name
  model_field_cache[from_model_name] = model_field_cache[from_model_name] << name

  __getobj__.send __callee__, name, opts
end