Skip to content

Commit

Permalink
Cleanup respond_to and reader methods
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Jan 12, 2012
1 parent 6267fb8 commit 60ebff7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/mongoid/attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def remove_attribute(name)
def respond_to?(*args)
(Mongoid.allow_dynamic_fields &&
attributes &&
attributes.has_key?(args.first.to_s.delete("="))
attributes.has_key?(args.first.to_s.reader)
) || super
end

Expand Down
2 changes: 1 addition & 1 deletion lib/mongoid/extensions/string/inflections.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def invert
#
# @return [ String ] The string stripped of "=".
def reader
writer? ? gsub("=", "") : self
delete("=")
end

# Is this string a writer?
Expand Down

0 comments on commit 60ebff7

Please sign in to comment.