diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/active_relation/relations/base.rb | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/lib/active_relation/relations/base.rb b/lib/active_relation/relations/base.rb index c4a887eecd..67a64b9aa6 100644 --- a/lib/active_relation/relations/base.rb +++ b/lib/active_relation/relations/base.rb @@ -38,8 +38,8 @@ module ActiveRelation Predicates::RelationInclusion.new(attribute, self) end - def select(*s) - Selection.new(self, *s) + def select(*predicates) + Selection.new(self, *predicates) end def project(*attributes) @@ -62,21 +62,10 @@ module ActiveRelation Deletion.new(self) end - class JoinOperation - attr_reader :join_sql, :relation1, :relation2 - - def initialize(join_sql, relation1, relation2) - @join_sql, @relation1, @relation2 = join_sql, relation1, relation2 - end - + JoinOperation = Struct.new(:join_sql, :relation1, :relation2) do def on(*predicates) Join.new(join_sql, relation1, relation2, *predicates) end - - def ==(other) - (relation1 == other.relation1 and relation2 == other.relation2) or - (relation1 == other.relation2 and relation2 == other.relation1) - end end end include Operations |