diff options
author | Xavier Noria <fxn@hashref.com> | 2010-08-27 23:07:13 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-08-27 23:27:29 +0200 |
commit | 3b62667e7750a156332a32262f8fa4609ad2222a (patch) | |
tree | 2258041e61cc0eecaa0070433a214ee754e91f9b /railties/guides/source/active_support_core_extensions.textile | |
parent | df367adba121739c0b4a47dda6ac02e348746c65 (diff) | |
download | rails-3b62667e7750a156332a32262f8fa4609ad2222a.tar.gz rails-3b62667e7750a156332a32262f8fa4609ad2222a.tar.bz2 rails-3b62667e7750a156332a32262f8fa4609ad2222a.zip |
solves everything in guides raised by WARNINGS=1 (except for one which is abandoned atm)
Diffstat (limited to 'railties/guides/source/active_support_core_extensions.textile')
-rw-r--r-- | railties/guides/source/active_support_core_extensions.textile | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile index 561bae3be8..696db30efb 100644 --- a/railties/guides/source/active_support_core_extensions.textile +++ b/railties/guides/source/active_support_core_extensions.textile @@ -1685,27 +1685,7 @@ foreign_key = options[:foreign_key] || reflection.active_record.name.foreign_key NOTE: Defined in +active_support/core_ext/string/inflections.rb+. -h4. Conversions - -h5. +constantize+ - -The method +constantize+ expects the receiver to contain the name of a constant, and tries to get you the object stored in there, assuming it is defined: - -<ruby> -"ActiveRecord::Base".constantize # => ActiveRecord::Base -</ruby> - -The name is assumed to be top-level, no matter whether it starts with "::" or not. No lexical context is taken into account: - -<ruby> -C = 1 -module M - C = 2 - "C".constantize # => 1, same as "::C".constantize -end -</ruby> - -NOTE: Defined in +active_support/core_ext/string/conversions.rb+. +h4(#string-conversions). Conversions h5. +ord+ @@ -2041,7 +2021,7 @@ This method receives an arbitrary number of action names, and an optional hash o NOTE: Defined in +active_support/core_ext/array/extract_options.rb+. -h4. Conversions +h4(#array-conversions). Conversions h5. +to_sentence+ @@ -2985,7 +2965,7 @@ Date.new(2010, 1, 31).change(:month => 2) # => ArgumentError: invalid date </ruby> -h5. Durations +h5(#date-durations). Durations Durations can be added and substracted to dates: @@ -3191,7 +3171,7 @@ DateTime.current.change(:month => 2, :day => 30) # => ArgumentError: invalid date </ruby> -h5. Durations +h5(#datetime-durations). Durations Durations can be added and substracted to datetimes: @@ -3304,7 +3284,7 @@ Both +local_time+ and +utc_time+ accept up to seven positional arguments: year, If the time to be constructed lies beyond the range supported by +Time+ in the runtime platform, usecs are discarded and a +DateTime+ object is returned instead. -h5. Durations +h5(#time-durations). Durations Durations can be added and substracted to time objects: |