db/migrate/20150519124846_remove_unstandardized_custom_languages.rb
# Redefine all Active Record models, so that the migration doesn't depend on the version of code
Redefine all Active Record models, so that the migration doesn't depend on the version of code
Redefine all Active Record models so that the migration doesn ' t depend on the version of code
def communities_w_unstandard_locales(unstandard_locales)
    comms_w_unstandard_locale = []
    puts ""
    puts "-- Searching communities with unstandard locales"
    puts ""
    where_unstandard_locales(MigrationModel::Community, unstandard_locales).each do |c|
      intersection = c.locales.to_set.intersection(unstandard_locales)
      if !intersection.empty?
        comms_w_unstandard_locale << [c, intersection]
      end
    end
    comms_w_unstandard_locale
  end
def communities_w_unstandard_locales ( unstandard_locales ) comms_w_unstandard_locale = [ ] puts "" puts "-- Searching communities with unstandard locales" puts "" where_unstandard_locales ( MigrationModel :: Community , unstandard_locales ) . each do | c | intersection = c . locales . to_set . intersection ( unstandard_locales ) if ! intersection . empty? comms_w_unstandard_locale << [ c , intersection ] end end comms_w_unstandard_locale end
Redefine all Active Record models, so that the migration doesn't depend on the version of code
Redefine all Active Record models so that the migration doesn ' t depend on the version of code
unstandard_locales