提交 19a26736 编写于 作者: F Francesco Rodriguez

nodoc AR::Generators [ci skip]

上级 71c67d1f
......@@ -4,8 +4,8 @@
require 'active_record'
module ActiveRecord
module Generators
class Base < Rails::Generators::NamedBase #:nodoc:
module Generators # :nodoc:
class Base < Rails::Generators::NamedBase # :nodoc:
include Rails::Generators::Migration
# Set the current directory as base for the inherited generators.
......@@ -14,7 +14,7 @@ def self.base_root
end
# Implement the required interface for Rails::Generators::Migration.
def self.next_migration_number(dirname) #:nodoc:
def self.next_migration_number(dirname)
next_migration_number = current_migration_number(dirname) + 1
ActiveRecord::Migration.next_migration_number(next_migration_number)
end
......
require 'rails/generators/active_record'
module ActiveRecord
module Generators
class MigrationGenerator < Base
module Generators # :nodoc:
class MigrationGenerator < Base # :nodoc:
argument :attributes, :type => :array, :default => [], :banner => "field[:type][:index] field[:type][:index]"
def create_migration_file
......@@ -42,7 +42,7 @@ def index_name_for(attribute)
attribute.name.singularize.foreign_key
end.to_sym
end
private
def validate_file_name!
......
require 'rails/generators/active_record'
module ActiveRecord
module Generators
class ModelGenerator < Base
module Generators # :nodoc:
class ModelGenerator < Base # :nodoc:
argument :attributes, :type => :array, :default => [], :banner => "field[:type][:index] field[:type][:index]"
check_class_collision
......
require 'rails/generators/active_record'
module ActiveRecord
module Generators
class ObserverGenerator < Base
module Generators # :nodoc:
class ObserverGenerator < Base # :nodoc:
check_class_collision :suffix => "Observer"
def create_observer_file
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册