lib/mongoid/token.rb in mongoid_token-2.0.0 vs lib/mongoid/token.rb in mongoid_token-2.0.1
- old
+ new
@@ -36,10 +36,10 @@
set_callback(:save, :before) do |document|
document.create_token_if_nil options.field_name, options.pattern
end
if options.override_to_param?
- self.define_method :to_param do
+ self.send(:define_method, :to_param) do
self.send(options.field_name) || super
end
end
end
end