diff options
author | Akira Matsuda <ronnie@dio.jp> | 2016-12-25 03:38:30 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-25 03:38:30 +0900 |
commit | 5b874cf42a41b966ca223a278b77fd0b4144ddb6 (patch) | |
tree | b72e770a8e86596ff18f74bdbaa5805c1ccae21e /activerecord/lib/rails/generators | |
parent | e8ba0c0f21e2660b90f872fa4595156ca6190c77 (diff) | |
parent | 57290e63630ce0300e6fea28c1854339e9455a41 (diff) | |
download | rails-5b874cf42a41b966ca223a278b77fd0b4144ddb6.tar.gz rails-5b874cf42a41b966ca223a278b77fd0b4144ddb6.tar.bz2 rails-5b874cf42a41b966ca223a278b77fd0b4144ddb6.zip |
Merge pull request #27448 from kamipo/no_need_doc_for_nodoc_classes
No need `:doc:` for `:nodoc:` classes [ci skip]
Diffstat (limited to 'activerecord/lib/rails/generators')
-rw-r--r-- | activerecord/lib/rails/generators/active_record/migration/migration_generator.rb | 6 | ||||
-rw-r--r-- | activerecord/lib/rails/generators/active_record/model/model_generator.rb | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/activerecord/lib/rails/generators/active_record/migration/migration_generator.rb b/activerecord/lib/rails/generators/active_record/migration/migration_generator.rb index 1de2aff632..8511531af7 100644 --- a/activerecord/lib/rails/generators/active_record/migration/migration_generator.rb +++ b/activerecord/lib/rails/generators/active_record/migration/migration_generator.rb @@ -23,7 +23,7 @@ module ActiveRecord # Sets the default migration template that is being used for the generation of the migration. # Depending on command line arguments, the migration template and the table name instance # variables are set up. - def set_local_assigns! # :doc: + def set_local_assigns! @migration_template = "migration.rb" case file_name when /^(add|remove)_.*_(?:to|from)_(.*)/ @@ -42,13 +42,13 @@ module ActiveRecord end end - def set_index_names # :doc: + def set_index_names attributes.each_with_index do |attr, i| attr.index_name = [attr, attributes[i - 1]].map { |a| index_name_for(a) } end end - def index_name_for(attribute) # :doc: + def index_name_for(attribute) if attribute.foreign_key? attribute.name else diff --git a/activerecord/lib/rails/generators/active_record/model/model_generator.rb b/activerecord/lib/rails/generators/active_record/model/model_generator.rb index ff76881834..61a8d3c100 100644 --- a/activerecord/lib/rails/generators/active_record/model/model_generator.rb +++ b/activerecord/lib/rails/generators/active_record/model/model_generator.rb @@ -35,29 +35,29 @@ module ActiveRecord private - def attributes_with_index # :doc: + def attributes_with_index attributes.select { |a| !a.reference? && a.has_index? } end # FIXME: Change this file to a symlink once RubyGems 2.5.0 is required. - def generate_application_record # :doc: + def generate_application_record if self.behavior == :invoke && !application_record_exist? template "application_record.rb", application_record_file_name end end # Used by the migration template to determine the parent name of the model - def parent_class_name # :doc: + def parent_class_name options[:parent] || "ApplicationRecord" end - def application_record_exist? # :doc: + def application_record_exist? file_exist = nil in_root { file_exist = File.exist?(application_record_file_name) } file_exist end - def application_record_file_name # :doc: + def application_record_file_name @application_record_file_name ||= if mountable_engine? "app/models/#{namespaced_path}/application_record.rb" else |