aboutsummaryrefslogtreecommitdiffstats
path: root/lib/active_relation/relations/rename.rb
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-04-12 17:45:36 -0700
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-04-12 17:45:36 -0700
commit2f9b70b6179d0b66f80d6edd3eca1017aec70659 (patch)
tree03bbdfe9b30b245ac40fb04b4178ea65bd7fb2ce /lib/active_relation/relations/rename.rb
parent97f89cde2af330771d0df80491e718f8b0cb7dd6 (diff)
downloadrails-2f9b70b6179d0b66f80d6edd3eca1017aec70659.tar.gz
rails-2f9b70b6179d0b66f80d6edd3eca1017aec70659.tar.bz2
rails-2f9b70b6179d0b66f80d6edd3eca1017aec70659.zip
better test coverage of relational operations with blank data
Diffstat (limited to 'lib/active_relation/relations/rename.rb')
-rw-r--r--lib/active_relation/relations/rename.rb26
1 files changed, 0 insertions, 26 deletions
diff --git a/lib/active_relation/relations/rename.rb b/lib/active_relation/relations/rename.rb
deleted file mode 100644
index 9ab07707a0..0000000000
--- a/lib/active_relation/relations/rename.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-module ActiveRelation
- class Rename < Compound
- attr_reader :attribute, :pseudonym
-
- def initialize(relation, pseudonyms)
- @attribute, @pseudonym = pseudonyms.shift
- @relation = pseudonyms.empty?? relation : Rename.new(relation, pseudonyms)
- end
-
- def ==(other)
- self.class == other.class and
- relation == other.relation and
- attribute == other.attribute and
- pseudonym == other.pseudonym
- end
-
- def attributes
- relation.attributes.collect(&method(:christen))
- end
-
- private
- def christen(attribute)
- (attribute =~ self.attribute ? attribute.as(pseudonym) : attribute).bind(self) rescue nil
- end
- end
-end \ No newline at end of file