Module: AutoIncrement::ActiveRecord::ClassMethods
- Defined in:
- lib/auto_increment/active_record.rb
Overview
AutoIncrement::ActiveRecord::ClassMethods
Instance Method Summary collapse
Instance Method Details
#auto_increment(column = nil, **options) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/auto_increment/active_record.rb', line 11 def auto_increment(column = nil, **) column ||= .fetch(:column, :code) auto_increment_deprecate_type_mismatch(column, [:initial]) if .key?(:initial) send("before_#{.fetch(:before, :create)}") do |record| Incrementor.new(record, column, **).run end end |