aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZachary Scott <e@zzak.io>2015-05-24 21:18:34 -0700
committerZachary Scott <e@zzak.io>2015-05-24 21:18:34 -0700
commitd0a370ec93c7e1118f3f58effe2e64712d3492bd (patch)
tree28d20d48ac9cbcd32e4e152f50036f1ec82aafa0
parent83d0252fe3dabfc963f887c9b8fb07ced36c8e75 (diff)
parent6a074044df5acd8f9dbdc2679c9bbf3e0eacaa87 (diff)
downloadrails-d0a370ec93c7e1118f3f58effe2e64712d3492bd.tar.gz
rails-d0a370ec93c7e1118f3f58effe2e64712d3492bd.tar.bz2
rails-d0a370ec93c7e1118f3f58effe2e64712d3492bd.zip
Merge branch 'master' of github.com:rails/rails
-rw-r--r--activesupport/lib/active_support/deprecation/behaviors.rb12
-rw-r--r--guides/source/active_record_basics.md4
2 files changed, 14 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/deprecation/behaviors.rb b/activesupport/lib/active_support/deprecation/behaviors.rb
index 9f9dca8453..0cdc7e96f7 100644
--- a/activesupport/lib/active_support/deprecation/behaviors.rb
+++ b/activesupport/lib/active_support/deprecation/behaviors.rb
@@ -38,6 +38,18 @@ module ActiveSupport
silence: ->(message, callstack) {},
}
+ # Behavior module allows to determine how to display deprecation messages.
+ # You can set any behaviors from +DEFAULT_BEHAVIORS+ constant or create
+ # custom behavior. Available behaviors:
+ #
+ # [+raise+] Raise <tt>ActiveSupport::DeprecationException</tt>.
+ # [+stderr+] Log all deprecation warnings to +$stderr+.
+ # [+log+] Log all deprecation warnings to +Rails.logger+.
+ # [+notify+] Use +ActiveSupport::Notifications+ to notify +deprecation.rails+.
+ # [+silence+] Do nothing.
+ #
+ # Setting behaviors only affects deprecations that happen after boot time.
+ # For more information you can read documentation for +behavior=+ method.
module Behavior
# Whether to print a backtrace along with the warning.
attr_accessor :debug
diff --git a/guides/source/active_record_basics.md b/guides/source/active_record_basics.md
index 6551ba0389..a227b54040 100644
--- a/guides/source/active_record_basics.md
+++ b/guides/source/active_record_basics.md
@@ -74,8 +74,8 @@ By default, Active Record uses some naming conventions to find out how the
mapping between models and database tables should be created. Rails will
pluralize your class names to find the respective database table. So, for
a class `Book`, you should have a database table called **books**. The Rails
-pluralization mechanisms are very powerful, being capable to pluralize (and
-singularize) both regular and irregular words. When using class names composed
+pluralization mechanisms are very powerful, being capable of pluralizing (and
+singularizing) both regular and irregular words. When using class names composed
of two or more words, the model class name should follow the Ruby conventions,
using the CamelCase form, while the table name must contain the words separated
by underscores. Examples: