From 82cd330dbac31d79e23cc06273321ecbac2b9077 Mon Sep 17 00:00:00 2001 From: Nick Kallen Date: Mon, 11 Feb 2008 23:02:33 -0800 Subject: aesthetic considerations --- lib/active_relation/relations/aggregation.rb | 5 ++++- lib/active_relation/relations/alias.rb | 4 +++- lib/active_relation/relations/join.rb | 9 ++++++--- lib/active_relation/relations/order.rb | 3 ++- lib/active_relation/relations/projection.rb | 4 +++- lib/active_relation/relations/range.rb | 3 ++- lib/active_relation/relations/rename.rb | 5 ++++- lib/active_relation/relations/selection.rb | 4 +++- lib/active_relation/relations/table.rb | 7 ++----- 9 files changed, 29 insertions(+), 15 deletions(-) diff --git a/lib/active_relation/relations/aggregation.rb b/lib/active_relation/relations/aggregation.rb index efa6ea260c..692a922ca7 100644 --- a/lib/active_relation/relations/aggregation.rb +++ b/lib/active_relation/relations/aggregation.rb @@ -7,7 +7,10 @@ module ActiveRelation end def ==(other) - self.class == other.class and relation == other.relation and groupings == other.groupings and expressions == other.expressions + self.class == other.class and + relation == other.relation and + groupings == other.groupings and + expressions == other.expressions end def qualify diff --git a/lib/active_relation/relations/alias.rb b/lib/active_relation/relations/alias.rb index 7b03a8c2ab..5b45d9dce4 100644 --- a/lib/active_relation/relations/alias.rb +++ b/lib/active_relation/relations/alias.rb @@ -11,7 +11,9 @@ module ActiveRelation end def ==(other) - self.class == other.class and relation == other.relation and @alias == other.alias + self.class == other.class and + relation == other.relation and + @alias == other.alias end end end \ No newline at end of file diff --git a/lib/active_relation/relations/join.rb b/lib/active_relation/relations/join.rb index 5b2efe727f..be2e89dd82 100644 --- a/lib/active_relation/relations/join.rb +++ b/lib/active_relation/relations/join.rb @@ -8,9 +8,12 @@ module ActiveRelation def ==(other) self.class == other.class and - predicates == other.predicates and - ((relation1 == other.relation1 and relation2 == other.relation2) or - (relation2 == other.relation1 and relation1 == other.relation2)) + predicates == other.predicates and ( + (relation1 == other.relation1 and + relation2 == other.relation2) or + (relation2 == other.relation1 and + relation1 == other.relation2) + ) end def qualify diff --git a/lib/active_relation/relations/order.rb b/lib/active_relation/relations/order.rb index 688207f7a9..a23da967fd 100644 --- a/lib/active_relation/relations/order.rb +++ b/lib/active_relation/relations/order.rb @@ -7,7 +7,8 @@ module ActiveRelation end def ==(other) - relation == other.relation and orders == other.orders + relation == other.relation and + orders == other.orders end def qualify diff --git a/lib/active_relation/relations/projection.rb b/lib/active_relation/relations/projection.rb index 78698603f0..9e0725f6c5 100644 --- a/lib/active_relation/relations/projection.rb +++ b/lib/active_relation/relations/projection.rb @@ -8,7 +8,9 @@ module ActiveRelation end def ==(other) - self.class == other.class and relation == other.relation and projections == other.projections + self.class == other.class and + relation == other.relation and + projections == other.projections end def qualify diff --git a/lib/active_relation/relations/range.rb b/lib/active_relation/relations/range.rb index 83af03fc0e..7f120ab9e5 100644 --- a/lib/active_relation/relations/range.rb +++ b/lib/active_relation/relations/range.rb @@ -7,7 +7,8 @@ module ActiveRelation end def ==(other) - relation == other.relation and range == other.range + relation == other.relation and + range == other.range end def limit diff --git a/lib/active_relation/relations/rename.rb b/lib/active_relation/relations/rename.rb index c41cd1bdc5..83ab41df70 100644 --- a/lib/active_relation/relations/rename.rb +++ b/lib/active_relation/relations/rename.rb @@ -8,7 +8,10 @@ module ActiveRelation end def ==(other) - self.class == other.class and relation == other.relation and attribute == other.attribute and pseudonym == other.pseudonym + self.class == other.class and + relation == other.relation and + attribute == other.attribute and + pseudonym == other.pseudonym end def qualify diff --git a/lib/active_relation/relations/selection.rb b/lib/active_relation/relations/selection.rb index 5f1726d381..98f56b0cbd 100644 --- a/lib/active_relation/relations/selection.rb +++ b/lib/active_relation/relations/selection.rb @@ -8,7 +8,9 @@ module ActiveRelation end def ==(other) - self.class == other.class and relation == other.relation and predicate == other.predicate + self.class == other.class and + relation == other.relation and + predicate == other.predicate end def qualify diff --git a/lib/active_relation/relations/table.rb b/lib/active_relation/relations/table.rb index d6ab45dcea..c8ccb22fdd 100644 --- a/lib/active_relation/relations/table.rb +++ b/lib/active_relation/relations/table.rb @@ -19,11 +19,8 @@ module ActiveRelation def prefix_for(attribute) name end - - def aliased_prefix_for(attribute) - name - end - + alias_method :aliased_prefix_for, :prefix_for + protected def table_sql "#{quote_table_name(name)}" -- cgit v1.2.3