Module: ArelHash
- Defined in:
- lib/arel_hash.rb,
lib/arel_hash/version.rb,
lib/arel_hash/optimizer.rb,
lib/arel_hash/sanitizer.rb,
lib/arel_hash/node_factory.rb,
lib/arel_hash/arel_hash_factory.rb
Defined Under Namespace
Classes: ArelHashFactory, NodeFactory, Optimizer, Sanitizer
Constant Summary
collapse
- Nodes =
Arel::Nodes
- Equality =
Nodes::Equality
- ZERO_RESULTS_NODE =
Equality.new(Nodes::build_quoted('f'), Nodes::build_quoted('t'))
- ZERO_RESULTS_HASH =
{ or: [] }
- NO_FILTER_HASH =
{ and: [] }
- VERSION =
"0.0.1"
Class Method Summary
collapse
Class Method Details
.create_from_active_record(hash, properties) ⇒ Object
.create_node(table, hash) ⇒ Object
.singleton_tuple!(hash) ⇒ Object
23
24
25
26
|
# File 'lib/arel_hash.rb', line 23
def self.singleton_tuple!(hash)
raise "#{hash}: only hashes with maximum one key are supported" unless hash.length == 1
return hash.keys.first, hash.values.first
end
|