class LikeSystemGenerator
LikeSystemGenerator
class
This class generates the like model migration in like system
Public Class Methods
next_migration_number(path)
click to toggle source
Retrieves the next migration number
@path [String] path - the path to calculate the next migration number @return [String]
# File lib/generators/like_system/like_system_generator.rb, line 35 def self.next_migration_number(path) ActiveRecord::Generators::Base.next_migration_number(path) end
source_root()
click to toggle source
Retrieves the source root
@return [String]
# File lib/generators/like_system/like_system_generator.rb, line 25 def self.source_root @source_root ||= File.dirname(__FILE__) + '/templates' end
Public Instance Methods
generate_migration()
click to toggle source
Generates the migration
# File lib/generators/like_system/like_system_generator.rb, line 42 def generate_migration migration_template 'migration.rb', 'db/migrate/create_likes.rb' end