Module: ActiveRecordExtended::Patch::ArrayHandlerPatch
- Defined in:
- lib/active_record_extended/patch/array_handler_patch.rb
Instance Method Summary collapse
Instance Method Details
#call(attribute, value) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/active_record_extended/patch/array_handler_patch.rb', line 9 def call(attribute, value) cache = ActiveRecord::Base.connection.schema_cache if cache.data_source_exists?(attribute.relation.name) column = cache.columns(attribute.relation.name).detect { |col| col.name.to_s == attribute.name.to_s } return attribute.eq(value) if column.try(:array) end super end |