Skip to content

Instantly share code, notes, and snippets.

@gotjosh
Created February 22, 2012 16:31
Show Gist options
  • Select an option

  • Save gotjosh/1885899 to your computer and use it in GitHub Desktop.

Select an option

Save gotjosh/1885899 to your computer and use it in GitHub Desktop.
class TranslateProperties < ActiveRecord::Migration
def self.up
::Refinery::Properties.reset_column_information
unless defined?(::Refinery::Properties::Translation) && ::Refinery::Properties.table_exists?
::Refinery::Properties.create_translation_table!({
:title => :string,
:location => :string,
:short_description => :text,
:directions => :text,
:amenities => :text,
:beds => :text,
:entertainment => :text,
:kitchen => :text,
:outdoor_features => :text,
:view_location => :text,
:communications => :text,
:suitability => :text,
:policies => :text,
:specifications => :text,
:walk_distance => :text,
:ten_minutes_driving => :text,
:thirty_minutes_driving => :text,
:airports => :text
}, {
:migrate_data => true
})
end
end
def self.down
::Refinery::Properties.reset_column_information
::Refinery::Properties.drop_translation_table!
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment