Class: ArelHash::ArelHashFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/arel_hash/arel_hash_factory.rb

Instance Method Summary collapse

Constructor Details

#initialize(properties) ⇒ ArelHashFactory

Returns a new instance of ArelHashFactory.



3
4
5
# File 'lib/arel_hash/arel_hash_factory.rb', line 3

def initialize(properties)
  @properties = properties
end

Instance Method Details

#create_from_active_record(hash) ⇒ Object



7
8
9
# File 'lib/arel_hash/arel_hash_factory.rb', line 7

def create_from_active_record(hash)
  { :and => hash.map { |k, v| name_value_to_arel_hash(k.to_sym, v) } }
end