Class: MyFeeds::Generators::LikesGenerator

Inherits:
ActiveRecord::Generators::Base
  • Object
show all
Defined in:
lib/generators/my_feeds/likes_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject


9
10
11
# File 'lib/generators/my_feeds/likes_generator.rb', line 9

def self.source_root
  @source_root ||= File.join(File.dirname(__FILE__), '../templates')
end

Instance Method Details

#create_migrationObject


13
14
15
# File 'lib/generators/my_feeds/likes_generator.rb', line 13

def create_migration
  migration_template 'likes_migration.rb', 'db/migrate/likes_migration.rb'
end

#create_modelObject


17
18
19
# File 'lib/generators/my_feeds/likes_generator.rb', line 17

def create_model
  template "like.rb", File.join('app/models', "like.rb")
end