Sha256: a4769d8e3c2dce6c526b2ea3255aa4923782e1d973a24a1c2e127b817dff84a9
Contents?: true
Size: 998 Bytes
Versions: 6
Compression:
Stored size: 998 Bytes
Contents
require 'rails/generators/migration' require 'rails/generators/active_record' ### # FollowSystemGenerator class # # This class generates the follow model migration in follow system ### class FollowSystemGenerator < Rails::Generators::Base ### # Includes Rails::Generators::Migration ### include Rails::Generators::Migration ### # Generator description definition ### desc "Generates a migration for the Follow model" ### # Retrieves the source root # # @return [String] ### def self.source_root @source_root ||= File.dirname(__FILE__) + '/templates' end ### # Retrieves the next migration number # # @path [String] path - the path to calculate the next migration number # @return [String] ### def self.next_migration_number(path) ActiveRecord::Generators::Base.next_migration_number(path) end ### # Generates the migration ### def generate_migration migration_template 'migration.rb', 'db/migrate/create_follows.rb' end end
Version data entries
6 entries across 6 versions & 1 rubygems