Caused by
The issue appear after changing the class name, let's say
class Documents
include Mongoid::Document
auto_increment :sequence
store_in collection: 'document'
end
here the seq_name = 'documents'
class Document
include Mongoid::Document
auto_increment :sequence
store_in collection: 'document'
end
but here the seq_name = 'document'
Solution
|
seq_name = options[:name] || "#{self.name.downcase}_#{name}" |
to
seq_name = options[:name] || "#{self.collection.name.downcase}_#{name}"
Note
this will break backward compatibility
Caused by
The issue appear after changing the class name, let's say
here the
seq_name = 'documents'but here the
seq_name = 'document'Solution
mongoid_auto_increment/lib/mongoid_auto_increment.rb
Line 15 in 350e93b
to
Note