Method: ROM::SQL::Relation::Reading#exists
- Defined in:
- lib/rom/sql/relation/reading.rb
#exists(other, condition = nil) ⇒ SQL::Relation
Restrict with rows from another relation. Accepts only SQL relations and uses the EXISTS clause under the hood
941 942 943 944 |
# File 'lib/rom/sql/relation/reading.rb', line 941 def exists(other, condition = nil) join_condition = condition || associations[other.name].join_keys where(other.where(join_condition).dataset.exists) end |