lib/mongoid/ids.rb in mongoid-ids-0.1.1 vs lib/mongoid/ids.rb in mongoid-ids-0.1.7
- old
+ new
@@ -25,11 +25,10 @@
else
set_token_callbacks(options)
add_token_field_and_index(options)
define_custom_finders(options) if options.skip_finders? == false
- override_to_param(options) if options.override_to_param?
end
end
private
def add_token_field_and_index(options)
@@ -53,15 +52,9 @@
document.create_token_if_nil options.field_name, options.pattern
end
set_callback(:save, :before) do |document|
document.create_token_if_nil options.field_name, options.pattern
- end
- end
-
- def override_to_param(options)
- self.send(:define_method, :to_param) do
- self.send(options.field_name) || super()
end
end
end
protected