suweller / mongoid-autoinc

⬆ Auto incrementing fields for Mongoid documents
MIT License
62 stars 44 forks source link

Allow more than one field as scope? #17

Closed jmuheim closed 10 years ago

jmuheim commented 10 years ago

Hi

Is it possible to have more than one field as scope?

increments :number, scope: [:client_id, :some_other_field]

Thank you.

jmuheim commented 10 years ago

Ah, I see how to do this using a scope: scope: -> { "#{client_id}_#{some_other_field}" }.