Module: KSUID::ActiveRecord
- Defined in:
- lib/ksuid/activerecord.rb,
lib/ksuid/activerecord/type.rb,
lib/ksuid/activerecord/binary_type.rb,
lib/ksuid/activerecord/table_definition.rb
Overview
Enables an Active Record model to have a KSUID attribute
Defined Under Namespace
Modules: TableDefinition Classes: BinaryType, Type
Class Method Summary collapse
-
.[](field, created_at: false, binary: false) ⇒ Module
Builds a module to include into the model.
Class Method Details
.[](field, created_at: false, binary: false) ⇒ Module
Builds a module to include into the model
29 30 31 32 33 34 35 36 |
# File 'lib/ksuid/activerecord.rb', line 29 def self.[](field, created_at: false, binary: false) Module .new .tap do |mod| define_attribute(field, mod, binary) define_created_at(field, mod) if created_at end end |