lib/torque/postgresql/adapter/schema_definitions.rb in torque-postgresql-0.2.12 vs lib/torque/postgresql/adapter/schema_definitions.rb in torque-postgresql-0.2.13
- old
+ new
@@ -1,14 +1,20 @@
module Torque
module PostgreSQL
module Adapter
module ColumnMethods
+ # 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
def interval(*args, **options)
args.each { |name| column(name, :interval, options) }
end
+ # 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
def enum(*args, **options)
args.each do |name|
type = options.fetch(:subtype, name)
column(name, type, options)
end
@@ -19,10 +25,10 @@
module TableDefinition
include ColumnMethods
attr_reader :inherits
- def initialize(name, *args, **options)
+ def initialize(name, *_, **options)
old_args = []
old_args << options.delete(:temporary) || false
old_args << options.delete(:options)
old_args << options.delete(:as)
comment = options.delete(:comment)