From 2fa1ff4e63f27d49a529116bb5e9933a0f385c3e Mon Sep 17 00:00:00 2001 From: Nick Kallen Date: Mon, 7 Jan 2008 18:59:32 -0800 Subject: nk --- lib/active_relation.rb | 2 -- lib/active_relation/extensions/range.rb | 0 lib/active_relation/predicates/binary_predicate.rb | 5 ----- lib/active_relation/predicates/range_inclusion_predicate.rb | 0 lib/active_relation/relations/attribute.rb | 4 ++-- lib/active_relation/relations/rename_relation.rb | 12 ++++++------ 6 files changed, 8 insertions(+), 15 deletions(-) delete mode 100644 lib/active_relation/extensions/range.rb delete mode 100644 lib/active_relation/predicates/range_inclusion_predicate.rb (limited to 'lib') diff --git a/lib/active_relation.rb b/lib/active_relation.rb index 0d7af7bfb8..7cdbd5c02d 100644 --- a/lib/active_relation.rb +++ b/lib/active_relation.rb @@ -30,11 +30,9 @@ require 'active_relation/predicates/less_than_predicate' require 'active_relation/predicates/less_than_or_equal_to_predicate' require 'active_relation/predicates/greater_than_predicate' require 'active_relation/predicates/greater_than_or_equal_to_predicate' -require 'active_relation/predicates/range_inclusion_predicate' require 'active_relation/predicates/relation_inclusion_predicate' require 'active_relation/predicates/match_predicate' -require 'active_relation/extensions/range' require 'active_relation/extensions/object' require 'active_relation/extensions/array' require 'active_relation/extensions/base' diff --git a/lib/active_relation/extensions/range.rb b/lib/active_relation/extensions/range.rb deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/active_relation/predicates/binary_predicate.rb b/lib/active_relation/predicates/binary_predicate.rb index f5c420c833..c467d63310 100644 --- a/lib/active_relation/predicates/binary_predicate.rb +++ b/lib/active_relation/predicates/binary_predicate.rb @@ -5,11 +5,6 @@ class BinaryPredicate < Predicate @attribute1, @attribute2 = attribute1, attribute2 end - def ==(other) - super and - (attribute1.eql?(other.attribute1) and attribute2.eql?(other.attribute2)) - end - def qualify self.class.new(attribute1.qualify, attribute2.qualify) end diff --git a/lib/active_relation/predicates/range_inclusion_predicate.rb b/lib/active_relation/predicates/range_inclusion_predicate.rb deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/active_relation/relations/attribute.rb b/lib/active_relation/relations/attribute.rb index 7583553b80..9ccbb495ea 100644 --- a/lib/active_relation/relations/attribute.rb +++ b/lib/active_relation/relations/attribute.rb @@ -5,7 +5,7 @@ class Attribute @relation, @name, @aliaz = relation, name, aliaz end - def aliazz(aliaz) + def alias(aliaz) Attribute.new(relation, name, aliaz) end @@ -14,7 +14,7 @@ class Attribute end def qualify - aliazz(qualified_name) + self.alias(qualified_name) end module Predications diff --git a/lib/active_relation/relations/rename_relation.rb b/lib/active_relation/relations/rename_relation.rb index 8acf5091b2..3218889f33 100644 --- a/lib/active_relation/relations/rename_relation.rb +++ b/lib/active_relation/relations/rename_relation.rb @@ -1,13 +1,13 @@ class RenameRelation < CompoundRelation - attr_reader :relation, :schmattribute, :aliaz + attr_reader :relation, :schmattribute, :alias def initialize(relation, renames) - @schmattribute, @aliaz = renames.shift + @schmattribute, @alias = renames.shift @relation = renames.empty?? relation : RenameRelation.new(relation, renames) end def ==(other) - relation == other.relation and schmattribute.eql?(other.schmattribute) and aliaz == other.aliaz + relation == other.relation and schmattribute.eql?(other.schmattribute) and self.alias == other.alias end def attributes @@ -15,13 +15,13 @@ class RenameRelation < CompoundRelation end def qualify - RenameRelation.new(relation.qualify, schmattribute.qualify => aliaz) + RenameRelation.new(relation.qualify, schmattribute.qualify => self.alias) end protected def attribute(name) case - when name == aliaz then schmattribute.aliazz(aliaz) + when name == self.alias then schmattribute.alias(self.alias) when relation[name].eql?(schmattribute) then nil else relation[name] end @@ -29,6 +29,6 @@ class RenameRelation < CompoundRelation private def substitute(a) - a.eql?(schmattribute) ? a.aliazz(aliaz) : a + a.eql?(schmattribute) ? a.alias(self.alias) : a end end \ No newline at end of file -- cgit v1.2.3