Class: HasFriends::Generators::FriendsCounter
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- HasFriends::Generators::FriendsCounter
- Includes:
- Rails::Generators::Migration, Thor::Actions
- Defined in:
- lib/has_friends/generators/friends_counter.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(path) ⇒ Object
18 19 20 |
# File 'lib/has_friends/generators/friends_counter.rb', line 18 def self.next_migration_number(path) Time.new.utc.strftime("%Y%m%d%H%M%S") end |
.source_root ⇒ Object
14 15 16 |
# File 'lib/has_friends/generators/friends_counter.rb', line 14 def self.source_root @source_root ||= File.dirname(__FILE__) + "/templates" end |
Instance Method Details
#create_migration_file ⇒ Object
22 23 24 25 |
# File 'lib/has_friends/generators/friends_counter.rb', line 22 def create_migration_file migration_template "add_friends_counter.rb", File.join('db','migrate', "add_friends_count_to_#{tableName.downcase}.rb") end |