Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update to make new define_dynamic_writer change work with more jrubies

  • Loading branch information...
commit 77ec3f1078673778cc1f2480dadc497bd3380442 1 parent 0c60ee4
@mzsanford authored
View
3  lib/mongoid/attributes.rb
@@ -100,7 +100,8 @@ def respond_to?(name, include_private = false)
super || (
Mongoid.allow_dynamic_fields &&
attributes &&
- attributes.has_key?(name.to_s.reader)
+ attributes.has_key?(name.to_s.reader) &&
+ name.to_s.valid_method_name?
)
end
View
3  lib/mongoid/attributes/processing.rb
@@ -120,8 +120,7 @@ def pending_nested
def process_attribute(name, value)
writer_method = "#{name}="
responds = respond_to?(writer_method)
- if Mongoid.allow_dynamic_fields && (!responds ||
- !writer_method.valid_method_name?)
+ if Mongoid.allow_dynamic_fields && !responds
write_attribute(name, value)
else
raise Errors::UnknownAttribute.new(self.class, name) unless responds
Please sign in to comment.
Something went wrong with that request. Please try again.