Sha256: a1d5aa5d9a47d6128b652c6ea5e2c5d791452950d7b055d161dbdef3fb5d471b
Contents?: true
Size: 788 Bytes
Versions: 16
Compression:
Stored size: 788 Bytes
Contents
module Gaku module Migrations def self.included(_base) ActiveRecord::ConnectionAdapters::Table.send :include, TableDefinition ActiveRecord::ConnectionAdapters::TableDefinition.send :include, TableDefinition end module TableDefinition def person_fields column :name, :string column :surname, :string column :middle_name, :string column :name_reading, :string, default: '' column :middle_name_reading, :string , default: '' column :surname_reading, :string, default: '' column :gender, :boolean column :birth_date, :date end def counters(*fields) fields.each do |field| column("#{field}_count", :integer, default: 0) end end end end end
Version data entries
16 entries across 16 versions & 2 rubygems