Module: Torque::PostgreSQL::Adapter::ColumnMethods
- Included in:
- TableDefinition
- Defined in:
- lib/torque/postgresql/adapter/schema_definitions.rb
Instance Method Summary collapse
-
#enum(*args, **options) ⇒ Object
Creates a column with an enum type, needing to specify the subtype, which is basically the name of the type defined prior creating the column.
-
#enum_set(*args, **options) ⇒ Object
Creates a column with an enum array type, needing to specify the subtype, which is basically the name of the type defined prior creating the column.
-
#interval(*args, **options) ⇒ Object
Creates a column with an interval type, allowing span of times and dates to be stored without having to store a seconds-based integer or any sort of other approach.
Instance Method Details
#enum(*args, **options) ⇒ Object
Creates a column with an enum type, needing to specify the subtype, which is basically the name of the type defined prior creating the column
16 17 18 19 20 21 |
# File 'lib/torque/postgresql/adapter/schema_definitions.rb', line 16 def enum(*args, **) args.each do |name| type = .fetch(:subtype, name) column(name, type, ) end end |
#enum_set(*args, **options) ⇒ Object
Creates a column with an enum array type, needing to specify the subtype, which is basically the name of the type defined prior creating the column
26 27 28 |
# File 'lib/torque/postgresql/adapter/schema_definitions.rb', line 26 def enum_set(*args, **) super(*args, **.merge(array: true)) end |
#interval(*args, **options) ⇒ Object
Creates a column with an interval type, allowing span of times and dates to be stored without having to store a seconds-based integer or any sort of other approach
9 10 11 |
# File 'lib/torque/postgresql/adapter/schema_definitions.rb', line 9 def interval(*args, **) args.each { |name| column(name, :interval, ) } end |