diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-02-27 11:25:15 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-02-27 11:25:15 -0800 |
commit | 26306420a6f483f23172d84176bf6aa57548651f (patch) | |
tree | f3968bf35da8e33ae98d2b63eaa2cc0e401fe794 /railties/lib/rails | |
parent | bf3ddfa28da8ca837ddce8c6744a6c1fd9a51243 (diff) | |
parent | 14e697cf2a1f2a4d223463839f6748fca4658bcf (diff) | |
download | rails-26306420a6f483f23172d84176bf6aa57548651f.tar.gz rails-26306420a6f483f23172d84176bf6aa57548651f.tar.bz2 rails-26306420a6f483f23172d84176bf6aa57548651f.zip |
Merge branch 'master' into adequaterecord
* master:
modify model generator warning message. refs [#174c9f0]
Replace "data store" with database [ci skip]
Return a hash rather than array from fetch_multi
Fix concerning module reference [ci skip]
Fixes docs typo in nested resource path helpers [skip ci]
Fix some validators when used on model instance
Pass strings to demodulize method
pass strings to the underscore method
speed up `underscore` in cases that don't need to do anything
pass the class name to `tableize`
[ci skip] Update list of files extensions in rake notes guide
Fix controller test not resetting @_url_options
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/engine.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/generators/model_helpers.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/railtie.rb | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 5c54cdaa70..5661094d95 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -371,7 +371,7 @@ module Rails end def isolate_namespace(mod) - engine_name(generate_railtie_name(mod)) + engine_name(generate_railtie_name(mod.name)) self.routes.default_scope = { module: ActiveSupport::Inflector.underscore(mod.name) } self.isolated = true diff --git a/railties/lib/rails/generators/model_helpers.rb b/railties/lib/rails/generators/model_helpers.rb index c4f45d344b..42c646543e 100644 --- a/railties/lib/rails/generators/model_helpers.rb +++ b/railties/lib/rails/generators/model_helpers.rb @@ -3,7 +3,7 @@ require 'rails/generators/active_model' module Rails module Generators module ModelHelpers # :nodoc: - PLURAL_MODEL_NAME_WARN_MESSAGE = "The model name '%s' was recognized as a plural, using the singular '%s'. " \ + PLURAL_MODEL_NAME_WARN_MESSAGE = "[WARNING] The model name '%s' was recognized as a plural, using the singular '%s' instead. " \ "Override with --force-plural or setup custom inflection rules for this noun before running the generator." mattr_accessor :skip_warn diff --git a/railties/lib/rails/railtie.rb b/railties/lib/rails/railtie.rb index c63e0c0758..8d7e804bdc 100644 --- a/railties/lib/rails/railtie.rb +++ b/railties/lib/rails/railtie.rb @@ -183,8 +183,8 @@ module Rails end protected - def generate_railtie_name(class_or_module) - ActiveSupport::Inflector.underscore(class_or_module).tr("/", "_") + def generate_railtie_name(string) + ActiveSupport::Inflector.underscore(string).tr("/", "_") end # If the class method does not have a method, then send the method call |