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