aboutsummaryrefslogtreecommitdiffstats
path: root/lib/active_relation/extensions
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-03-11 22:42:47 -0700
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-03-11 22:42:47 -0700
commita29ceffc9476c99ff02f0617d2e38627c526bac2 (patch)
treefc9aa702ad9a2f506a4a51b71791798fb8a6ca4b /lib/active_relation/extensions
parent98527c8f7dd64f086895c1576fb33e8b91071142 (diff)
downloadrails-a29ceffc9476c99ff02f0617d2e38627c526bac2.tar.gz
rails-a29ceffc9476c99ff02f0617d2e38627c526bac2.tar.bz2
rails-a29ceffc9476c99ff02f0617d2e38627c526bac2.zip
implemented hashing macro; implemented custom matcher testing this macro
Diffstat (limited to 'lib/active_relation/extensions')
-rw-r--r--lib/active_relation/extensions/object.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/active_relation/extensions/object.rb b/lib/active_relation/extensions/object.rb
index d13cf9aabb..c1269ee37b 100644
--- a/lib/active_relation/extensions/object.rb
+++ b/lib/active_relation/extensions/object.rb
@@ -1,4 +1,12 @@
-class Object
+class Object
+ def self.hash_on(delegatee)
+ def eql?(other)
+ self == other
+ end
+
+ delegate :hash, :to => delegatee
+ end
+
def bind(relation)
ActiveRelation::Scalar.new(self, relation)
end