Sha256: 819fc0499d223dc9171078e070be765f9c153bbd01d8a6566da3461c20c46d3e
Contents?: true
Size: 538 Bytes
Versions: 14
Compression:
Stored size: 538 Bytes
Contents
class CommentableGenerator < Rails::Generators::NamedBase source_root File.expand_path('../templates', __FILE__) include Rails::Generators::Migration def self.source_root @_acts_as_commentable_source_root ||= File.expand_path("../templates", __FILE__) end def self.next_migration_number(path) Time.now.utc.strftime("%Y%m%d%H%M%S") end 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 end
Version data entries
14 entries across 14 versions & 1 rubygems