Sha256: 648c7a30f4354243557f528db686f102d9e852da1c3acdf8ed95675c45bc6134

Contents?: true

Size: 468 Bytes

Versions: 15

Compression:

Stored size: 468 Bytes

Contents

class AddRuleTypeEnums < ActiveRecord::Migration[4.2]
  def change
    [Gemini::XyzRuleType, Gemini::MyRuleType, Gemini::GuardOne,
     Gemini::GuardTwo, Gemini::XyzEnum].each do |cl|
      values = cl.values
      str_values = values.map {|v| ActiveRecord::Base.connection.quote v}.
                   join(',')
      clstr = cl.to_s.sub('Gemini::','').underscore
      execute <<-SQL
         CREATE TYPE #{clstr} AS ENUM (#{str_values})
      SQL
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
marty-14.3.0 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-14.0.0 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-13.0.2 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-11.0.0 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-10.0.3 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-10.0.2 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-10.0.0 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-9.5.1 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-9.5.0 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-9.3.3 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-9.3.2 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-9.3.0 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-8.5.0 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-8.4.1 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-8.3.1 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb