class CommentableGenerator

Public Class Methods

next_migration_number(path) click to toggle source
# File lib/generators/commentable/commentable_generator.rb, line 9
def self.next_migration_number(path)
  Time.now.utc.strftime("%Y%m%d%H%M%S")
end
source_root() click to toggle source
# File lib/generators/commentable/commentable_generator.rb, line 5
def self.source_root
  @_acts_as_commentable_source_root ||= File.expand_path("../templates", __FILE__)
end

Public Instance Methods

create_model_file() click to toggle source
# File lib/generators/commentable/commentable_generator.rb, line 13
def create_model_file
  template "comment.rb", "app/models/#{file_path}.rb"
  migration_template "create_comments.rb", "db/migrate/create_#{plural_table_name}.rb"
end