Class: ActiveRecord::ConnectionAdapters::TableDefinition
- Inherits:
-
Object
- Object
- ActiveRecord::ConnectionAdapters::TableDefinition
- Defined in:
- lib/enumerated_attribute/rails_helpers.rb
Instance Method Summary collapse
Instance Method Details
#column_with_enumerated_attribute(name, type, options = {}) ⇒ Object
7 8 9 10 |
# File 'lib/enumerated_attribute/rails_helpers.rb', line 7 def column_with_enumerated_attribute(name, type, = {}) type = 'string' if type.to_s == 'enum' column_without_enumerated_attribute(name, type, ) end |
#enum(*args) ⇒ Object
13 14 15 16 17 |
# File 'lib/enumerated_attribute/rails_helpers.rb', line 13 def enum(*args) = args. column_names = args column_names.each { |name| column(name, 'string', ) } end |