diff options
6 files changed, 16 insertions, 37 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index fdddb33c31..ca2eb1ac10 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -365,7 +365,7 @@ module ActionView else object = record.is_a?(Array) ? record.last : record object_name = options[:as] || ActiveModel::Naming.param_key(object) - apply_form_for_options!(record, options) + apply_form_for_options!(record, object, options) end options[:html][:remote] = options.delete(:remote) if options.has_key?(:remote) @@ -380,8 +380,7 @@ module ActionView output.safe_concat('</form>') end - def apply_form_for_options!(object_or_array, options) #:nodoc: - object = object_or_array.is_a?(Array) ? object_or_array.last : object_or_array + def apply_form_for_options!(record, object, options) #:nodoc: object = convert_to_model(object) as = options[:as] @@ -392,7 +391,7 @@ module ActionView :method => method ) - options[:url] ||= polymorphic_path(object_or_array, :format => options.delete(:format)) + options[:url] ||= polymorphic_path(record, :format => options.delete(:format)) end private :apply_form_for_options! diff --git a/activesupport/lib/active_support/core_ext/time/conversions.rb b/activesupport/lib/active_support/core_ext/time/conversions.rb index 5a17fc1afa..0fdcd383f0 100644 --- a/activesupport/lib/active_support/core_ext/time/conversions.rb +++ b/activesupport/lib/active_support/core_ext/time/conversions.rb @@ -53,32 +53,4 @@ class Time def formatted_offset(colon = true, alternate_utc_string = nil) utc? && alternate_utc_string || ActiveSupport::TimeZone.seconds_to_utc_offset(utc_offset, colon) end - - # Converts a Time object to a Date, dropping hour, minute, and second precision. - # - # my_time = Time.now # => Mon Nov 12 22:59:51 -0500 2007 - # my_time.to_date # => Mon, 12 Nov 2007 - # - # your_time = Time.parse("1/13/2009 1:13:03 P.M.") # => Tue Jan 13 13:13:03 -0500 2009 - # your_time.to_date # => Tue, 13 Jan 2009 - def to_date - ::Date.new(year, month, day) - end unless method_defined?(:to_date) - - # A method to keep Time, Date and DateTime instances interchangeable on conversions. - # In this case, it simply returns +self+. - def to_time - self - end unless method_defined?(:to_time) - - # Converts a Time instance to a Ruby DateTime instance, preserving UTC offset. - # - # my_time = Time.now # => Mon Nov 12 23:04:21 -0500 2007 - # my_time.to_datetime # => Mon, 12 Nov 2007 23:04:21 -0500 - # - # your_time = Time.parse("1/13/2009 1:13:03 P.M.") # => Tue Jan 13 13:13:03 -0500 2009 - # your_time.to_datetime # => Tue, 13 Jan 2009 13:13:03 -0500 - def to_datetime - ::DateTime.civil(year, month, day, hour, min, sec, Rational(utc_offset, 86400)) - end unless method_defined?(:to_datetime) end diff --git a/activesupport/lib/active_support/notifications.rb b/activesupport/lib/active_support/notifications.rb index f549d2fff3..13f675c654 100644 --- a/activesupport/lib/active_support/notifications.rb +++ b/activesupport/lib/active_support/notifications.rb @@ -68,6 +68,10 @@ module ActiveSupport # Sometimes you do not want to subscribe to an event for the entire life of # the application. There are two ways to unsubscribe. # + # WARNING: The instrumentation framework is designed for long-running subscribers, + # use this feature sparingly because it wipes some internal caches and that has + # a negative impact on performance. + # # === Subscribe While a Block Runs # # You can subscribe to some event temporarily while some block runs. For diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index b292ed111e..eae74b4dd5 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -4,6 +4,8 @@ ## Rails 3.2.0 (unreleased) ## +* Turn gem has been removed from default Gemfile. We still looking for a best presentation for tests output. *Guillermo Iguaran* + * Rails::Plugin is deprecated and will be removed in Rails 4.0. Instead of adding plugins to vendor/plugins use gems or bundler with path or git dependencies. *Santiago Pastorino* * Guides are available as a single .mobi for the Kindle and free Kindle readers apps. *Michael Pearson & Xavier Noria* @@ -29,7 +31,8 @@ * Update Rails::Rack::Logger middleware to apply any tags set in config.log_tags to the newly ActiveSupport::TaggedLogging Rails.logger. This makes it easy to tag log lines with debug information like subdomain and request id -- both very helpful in debugging multi-user production applications *DHH* -* Default options to `rails new` can be set in ~/.railsrc *Guillermo Iguaran* +* Default options to `rails new` can be set in ~/.railsrc. You can specify extra command-line arguments to be used every time + 'rails new' runs in the .railsrc configuration file in your home directory. *Guillermo Iguaran* * Add destroy alias to Rails engines *Guillermo Iguaran* @@ -52,7 +55,7 @@ *GH 2564* *José Valim* - + ## Rails 3.1.1 (October 07, 2011) ## * Add jquery-rails to Gemfile of plugins, test/dummy app needs it. Closes #3091. *Santiago Pastorino* diff --git a/railties/guides/source/3_2_release_notes.textile b/railties/guides/source/3_2_release_notes.textile index 7a7127819a..ba536ed278 100644 --- a/railties/guides/source/3_2_release_notes.textile +++ b/railties/guides/source/3_2_release_notes.textile @@ -118,7 +118,7 @@ config.railties_order = [Blog::Engine, :main_app, :all] * Update <tt>Rails::Rack::Logger</tt> middleware to apply any tags set in <tt>config.log_tags</tt> to <tt>ActiveSupport::TaggedLogging</tt>. This makes it easy to tag log lines with debug information like subdomain and request id -- both very helpful in debugging multi-user production applications. -* Default options to +rails new+ can be set in <tt>~/.railsrc</tt>. +* Default options to +rails new+ can be set in <tt>~/.railsrc</tt>. You can specify extra command-line arguments to be used every time 'rails new' runs in the <tt>.railsrc</tt> configuration file in your home directory. * Add an alias +d+ for +destroy+. This works for engines too. @@ -132,6 +132,8 @@ rails g scaffold Post title:string:index author:uniq price:decimal{7,2} will create indexes for +title+ and +author+ with the latter being an unique index. Some types such as decimal accept custom options. In the example, +price+ will be a decimal column with precision and scale set to 7 and 2 respectively. +* Turn gem has been removed from default Gemfile. + * Remove old plugin generator +rails generate plugin+ in favor of +rails plugin new+ command. * Remove old <tt>config.paths.app.controller</tt> API in favor of <tt>config.paths["app/controller"]</tt>. diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile index bf8d328020..c30902c237 100644 --- a/railties/guides/source/active_support_core_extensions.textile +++ b/railties/guides/source/active_support_core_extensions.textile @@ -709,8 +709,7 @@ X.local_constants # => [:X1, :X2, :Y] X::Y.local_constants # => [:Y1, :X1] </ruby> -The names are returned as symbols. (The method +local_constant_names+ returns -strings, but +local_constant_names+ is deprecated.) +The names are returned as symbols. (The deprecated method +local_constant_names+ returns strings.) NOTE: Defined in +active_support/core_ext/module/introspection.rb+. |