class Attache::Rails::UpgradeV2ToV3Generator
Public Class Methods
has_many_attaches(name)
click to toggle source
# File lib/generators/attache/rails/upgrade_v2_to_v3_generator.rb, line 40 def self.has_many_attaches(name) $has_many_attaches.push([self.name, name]) end
has_one_attache(name)
click to toggle source
# File lib/generators/attache/rails/upgrade_v2_to_v3_generator.rb, line 36 def self.has_one_attache(name) $has_one_attache.push([self.name, name]) end
next_migration_number(dir)
click to toggle source
# File lib/generators/attache/rails/upgrade_v2_to_v3_generator.rb, line 8 def self.next_migration_number(dir) ActiveRecord::Generators::Base.next_migration_number(dir) end
source_root()
click to toggle source
# File lib/generators/attache/rails/upgrade_v2_to_v3_generator.rb, line 12 def self.source_root @source_root ||= File.expand_path('../templates', __FILE__) end
Public Instance Methods
generate_migration()
click to toggle source
# File lib/generators/attache/rails/upgrade_v2_to_v3_generator.rb, line 16 def generate_migration migration_template "upgrade_v2_to_v3_migration.rb.erb", "db/migrate/#{migration_file_name}" end
migration_class_name()
click to toggle source
# File lib/generators/attache/rails/upgrade_v2_to_v3_generator.rb, line 28 def migration_class_name migration_name.camelize end
migration_file_name()
click to toggle source
# File lib/generators/attache/rails/upgrade_v2_to_v3_generator.rb, line 24 def migration_file_name "#{migration_name.underscore}.rb" end
migration_name()
click to toggle source
# File lib/generators/attache/rails/upgrade_v2_to_v3_generator.rb, line 20 def migration_name "UpgradeAttacheFieldsFromV2ToV3" end