Sha256: a1543296ffe02169a925f0ab4c22be6b23f6303648fd8f0114d88ab80c6e85cd
Contents?: true
Size: 437 Bytes
Versions: 4
Compression:
Stored size: 437 Bytes
Contents
# +AutoIncrement+ module AutoIncrement # +AutoIncrement::ActiveRecord+ module ActiveRecord extend ActiveSupport::Concern # +AutoIncrement::ActiveRecord::ClassMethods+ module ClassMethods def auto_increment(column = nil, options = {}) options.reverse_merge! before: :create callback = "before_#{options[:before]}" send callback, Incrementor.new(column, options) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems