Class: Arel::Visitors::ToSql
- Inherits:
-
Object
- Object
- Arel::Visitors::ToSql
- Defined in:
- lib/composite_primary_keys/arel/to_sql.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#visit_CompositePrimaryKeys_CompositeKeys(o, collector) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/composite_primary_keys/arel/to_sql.rb', line 4 def visit_CompositePrimaryKeys_CompositeKeys o, collector values = o.map do |key| case key when Arel::Attributes::Attribute "#{key.relation.name}.#{key.name}" else key end end collector << "(#{values.join(', ')})" collector end |