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