Class: ArelHash::ArelHashFactory
- Inherits:
-
Object
- Object
- ArelHash::ArelHashFactory
- Defined in:
- lib/arel_hash/arel_hash_factory.rb
Instance Method Summary collapse
- #create_from_active_record(hash) ⇒ Object
-
#initialize(properties) ⇒ ArelHashFactory
constructor
A new instance of ArelHashFactory.
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 |