class ForestifyGenerator

See github.com/olkarls/has_permalink/blob/master/lib/generators/has_permalink_generator.rb

Public Class Methods

source_root() click to toggle source
# File lib/generators/forestify_generator.rb, line 8
def self.source_root
  @source_root ||= File.expand_path('../templates', __FILE__)
end

Public Instance Methods

generate_migration() click to toggle source
# File lib/generators/forestify_generator.rb, line 12
def generate_migration
  migration_template "forestify_migration.rb.erb", "db/migrate/#{migration_file_name}"
end

Protected Instance Methods

migration_class_name() click to toggle source
# File lib/generators/forestify_generator.rb, line 26
def migration_class_name
  migration_name.camelize
end
migration_file_name() click to toggle source
# File lib/generators/forestify_generator.rb, line 22
def migration_file_name
  "#{migration_name}.rb"
end
migration_name() click to toggle source
# File lib/generators/forestify_generator.rb, line 18
def migration_name
  "add_forestify_to_#{name.underscore}"
end