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-8.2.0 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-8.0.0 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-6.1.0 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-5.2.0 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-5.1.4 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-5.1.3 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-5.1.2 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-5.1.1 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-5.1.0 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-3.1.0 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-3.0.1 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-4.0.0.rc2 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-3.0.0 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.9.3 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.9.2 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.9.1 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.8.0 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.7.3 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.7.2 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb
marty-2.7.1 spec/dummy/db/migrate/20171220150101_add_rule_type_enums.rb