Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't use alias_method (instead just use proxy methods) for Keys#[]

and Keys#attribute (this way plugins that override read_key don't
also have to override those methods)
commit 71969bbcac51b3ac4601b6dcf020601e0282c852 1 parent e0f43db
@smtlaissezfaire smtlaissezfaire authored
View
4 lib/mongo_mapper/plugins/keys.rb
@@ -373,8 +373,8 @@ def read_key(key_name)
end
end
- alias_method :[], :read_key
- alias_method :attribute, :read_key
+ def [](key_name); read_key(key_name); end
+ def attribute(key_name); read_key(key_name); end
def []=(name, value)
write_key(name, value)
View
3  lib/mongo_mapper/plugins/keys/static.rb
@@ -22,9 +22,6 @@ def read_key(name)
end
end
- alias_method :[], :read_key
- alias_method :attribute, :read_key
-
private
def write_key(name, value)
Please sign in to comment.
Something went wrong with that request. Please try again.