lib/torque/postgresql/reflection/abstract_reflection.rb in torque-postgresql-1.0.0 vs lib/torque/postgresql/reflection/abstract_reflection.rb in torque-postgresql-1.0.1
- old
+ new
@@ -17,12 +17,12 @@
method(:join_keys).arity.eql?(0) ? join_keys : join_keys(klass)
end
# Manually build the join constraint
def build_join_constraint(table, foreign_table)
- klass_attr = table[torque_join_keys.key]
- source_attr = foreign_table[torque_join_keys.foreign_key]
+ klass_attr = table[torque_join_keys.key.to_s]
+ source_attr = foreign_table[torque_join_keys.foreign_key.to_s]
result = build_id_constraint(klass_attr, source_attr)
result = table.create_and([result, klass.send(:type_condition, table)]) \
if klass.finder_needs_type_condition?
@@ -32,12 +32,12 @@
# Build the id constraint checking if both types are perfect matching
def build_id_constraint(klass_attr, source_attr)
return klass_attr.eq(source_attr) unless connected_through_array?
# Klass and key are associated with the reflection Class
- klass_type = klass.columns_hash[torque_join_keys.key]
+ klass_type = klass.columns_hash[torque_join_keys.key.to_s]
# active_record and foreign_key are associated with the source Class
- source_type = active_record.columns_hash[torque_join_keys.foreign_key]
+ source_type = active_record.columns_hash[torque_join_keys.foreign_key.to_s]
# If both are attributes but the left side is not an array, and the
# right side is, use the ANY operation
any_operation = arel_array_to_any(klass_attr, source_attr, klass_type, source_type)
return klass_attr.eq(any_operation) if any_operation