Sha256: 4cd884760864df0a128b811f798dc627913ad5a08c33bede8170ea1d63ef104f

Contents?: true

Size: 469 Bytes

Versions: 79

Compression:

Stored size: 469 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

79 entries across 79 versions & 1 rubygems

Version Path
marty-2.1.5 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.3.2 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.3.1 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.3.0 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.1.4 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.1.3 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.1.2 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.1.1 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.1.0 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.0.9 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.0.8 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.0.7 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.0.6 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.0.5 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.0.4 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.0.3 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.0.2 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.0.1 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.0.0 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb