aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionmailer/CHANGELOG.md6
-rw-r--r--actionpack/CHANGELOG.md26
-rw-r--r--activemodel/CHANGELOG.md11
-rw-r--r--activemodel/lib/active_model/naming.rb1
-rw-r--r--activerecord/CHANGELOG.md11
-rw-r--r--activerecord/lib/active_record/associations/collection_association.rb2
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb11
-rw-r--r--activerecord/test/cases/associations/has_many_associations_test.rb7
-rw-r--r--activerecord/test/cases/connection_pool_test.rb53
-rw-r--r--activeresource/CHANGELOG.md5
-rw-r--r--activesupport/CHANGELOG.md5
-rw-r--r--activesupport/test/core_ext/hash_ext_test.rb2
-rw-r--r--railties/CHANGELOG.md5
13 files changed, 126 insertions, 19 deletions
diff --git a/actionmailer/CHANGELOG.md b/actionmailer/CHANGELOG.md
index fa0f8852fb..be7b82eecc 100644
--- a/actionmailer/CHANGELOG.md
+++ b/actionmailer/CHANGELOG.md
@@ -3,6 +3,11 @@
* Upgrade mail version to 2.4.3 *ML*
+## Rails 3.2.2 (March 1, 2012) ##
+
+* No changes.
+
+
## Rails 3.2.1 (January 26, 2012) ##
* No changes.
@@ -128,6 +133,7 @@
* Mail does not have "quoted_body", "quoted_subject" etc. All of these are accessed via body.encoded, subject.encoded etc
* Every object in a Mail object returns an object, never a string. So Mail.body returns a Mail::Body class object, need to call #encoded or #decoded to get the string you want.
+
* Mail::Message#set_content_type does not exist, it is simply Mail::Message#content_type
* Every mail message gets a unique message_id unless you specify one, had to change all the tests that check for equality with expected.encoded == actual.encoded to first replace their message_ids with control values
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md
index e447a5bb80..7565060668 100644
--- a/actionpack/CHANGELOG.md
+++ b/actionpack/CHANGELOG.md
@@ -1,12 +1,12 @@
## Rails 4.0.0 (unreleased) ##
-* Adds support for layouts when rendering a partial with a given collection. *serabe*
+* Adds support for layouts when rendering a partial with a given collection. *serabe*
-* Allows the route helper `root` to take a string argument. For example, `root 'pages#main'`. *bcardarella*
+* Allows the route helper `root` to take a string argument. For example, `root 'pages#main'`. *bcardarella*
-* Forms of persisted records use always PATCH (via the `_method` hack). *fxn*
+* Forms of persisted records use always PATCH (via the `_method` hack). *fxn*
-* For resources, both PATCH and PUT are routed to the `update` action. *fxn*
+* For resources, both PATCH and PUT are routed to the `update` action. *fxn*
* Don't ignore `force_ssl` in development. This is a change of behavior - use a `:if` condition to recreate the old behavior.
@@ -114,19 +114,21 @@
* `ActionView::Helpers::TextHelper#highlight` now defaults to the
HTML5 `mark` element. *Brian Cardarella*
+
## Rails 3.2.3 (unreleased) ##
-* Upgrade rack-cache to 1.2. *José Valim*
+* Upgrade rack-cache to 1.2. *José Valim*
+
+* ActionController::SessionManagement is removed. *Santiago Pastorino*
-* ActionController::SessionManagement is removed. *Santiago Pastorino*
+* Since the router holds references to many parts of the system like engines, controllers and the application itself, inspecting the route set can actually be really slow, therefore we default alias inspect to to_s. *José Valim*
-* Since the router holds references to many parts of the system like engines, controllers and the application itself, inspecting the route set can actually be really slow, therefore we default alias inspect to to_s. *José Valim*
+* Add a new line after the textarea opening tag. Closes #393 *Rafael Mendonça França*
-* Add a new line after the textarea opening tag. Closes #393 *rafaelfranca*
+* Always pass a respond block from to responder. We should let the responder decide what to do with the given overridden response block, and not short circuit it. *Prem Sichanugrist*
-* Always pass a respond block from to responder. We should let the responder to decide what to do with the given overridden response block, and not short circuit it. *sikachu*
+* Fixes layout rendering regression from 3.2.2. *José Valim*
-* Fixes layout rendering regression from 3.2.2. *José Valim*
## Rails 3.2.2 (March 1, 2012) ##
@@ -318,6 +320,7 @@
returned by the class method attribute_names will be wrapped. This fixes
the wrapping of nested attributes by adding them to attr_accessible.
+
## Rails 3.1.4 (March 1, 2012) ##
* Skip assets group in Gemfile and all assets configurations options
@@ -334,6 +337,7 @@
* Assets should use the request protocol by default or default to relative if no request is available *Jonathan del Strother*
+
## Rails 3.1.3 (November 20, 2011) ##
* Downgrade sprockets to ~> 2.0.3. Using 2.1.0 caused regressions.
@@ -343,6 +347,7 @@
*Jon Leighton*
+
## Rails 3.1.2 (November 18, 2011) ##
* Fix XSS security vulnerability in the `translate` helper method. When using interpolation
@@ -384,6 +389,7 @@
* Ensure users upgrading from 3.0.x to 3.1.x will properly upgrade their flash object in session (issues #3298 and #2509)
+
## Rails 3.1.1 (October 07, 2011) ##
* javascript_path and stylesheet_path now refer to /assets if asset pipelining
diff --git a/activemodel/CHANGELOG.md b/activemodel/CHANGELOG.md
index b69d1de672..c6d8eae46c 100644
--- a/activemodel/CHANGELOG.md
+++ b/activemodel/CHANGELOG.md
@@ -6,10 +6,17 @@
* Trim down Active Model API by removing `valid?` and `errors.full_messages` *José Valim*
+
+## Rails 3.2.2 (March 1, 2012) ##
+
+* No changes.
+
+
## Rails 3.2.1 (January 26, 2012) ##
* No changes.
+
## Rails 3.2.0 (January 20, 2012) ##
* Deprecated `define_attr_method` in `ActiveModel::AttributeMethods`, because this only existed to
@@ -25,14 +32,17 @@
* Provide mass_assignment_sanitizer as an easy API to replace the sanitizer behavior. Also support both :logger (default) and :strict sanitizer behavior *Bogdan Gusiev*
+
## Rails 3.1.3 (November 20, 2011) ##
* No changes
+
## Rails 3.1.2 (November 18, 2011) ##
* No changes
+
## Rails 3.1.1 (October 7, 2011) ##
* Remove hard dependency on bcrypt-ruby to avoid make ActiveModel dependent on a binary library.
@@ -42,6 +52,7 @@
See GH #2687. *Guillermo Iguaran*
+
## Rails 3.1.0 (August 30, 2011) ##
* Alternate I18n namespace lookup is no longer supported.
diff --git a/activemodel/lib/active_model/naming.rb b/activemodel/lib/active_model/naming.rb
index 755e54efcd..fd0bc4e8e9 100644
--- a/activemodel/lib/active_model/naming.rb
+++ b/activemodel/lib/active_model/naming.rb
@@ -2,6 +2,7 @@ require 'active_support/inflector'
require 'active_support/core_ext/hash/except'
require 'active_support/core_ext/module/introspection'
require 'active_support/core_ext/module/deprecation'
+require 'active_support/core_ext/object/blank'
module ActiveModel
class Name < String
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index a409c84655..9a036bdd66 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -152,6 +152,7 @@
* PostgreSQL hstore types are automatically deserialized from the database.
+
## Rails 3.2.3 (unreleased) ##
* Whitelist all attribute assignment by default. Change the default for newly generated applications to whitelist all attribute assignment. Also update the generated model classes so users are reminded of the importance of attr_accessible. *NZKoz*
@@ -166,6 +167,12 @@
* Fix #5069 - Protect foreign key from mass assignment through association builder. *byroot*
+
+## Rails 3.2.2 (March 1, 2012) ##
+
+* No changes.
+
+
## Rails 3.2.1 (January 26, 2012) ##
* The threshold for auto EXPLAIN is ignored if there's no logger. *fxn*
@@ -356,6 +363,7 @@
*Aaron Christy*
+
## Rails 3.1.4 (March 1, 2012) ##
* Fix a custom primary key regression *GH 3987*
@@ -383,6 +391,7 @@
*Julius de Bruijn*
+
### Rails 3.1.3 (November 20, 2011) ##
* Perf fix: If we're deleting all records in an association, don't add a IN(..) clause
@@ -396,6 +405,7 @@
*Christos Zisopoulos and Kenny J*
+
### Rails 3.1.2 (November 18, 2011) ##
* Fix bug with PostgreSQLAdapter#indexes. When the search path has multiple schemas, spaces
@@ -443,6 +453,7 @@
*Kenny J*
+
## Rails 3.1.1 (October 7, 2011) ##
* Add deprecation for the preload_associations method. Fixes #3022.
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb
index b2136605e1..da4c311bce 100644
--- a/activerecord/lib/active_record/associations/collection_association.rb
+++ b/activerecord/lib/active_record/associations/collection_association.rb
@@ -544,7 +544,7 @@ module ActiveRecord
# If using a custom finder_sql, #find scans the entire collection.
def find_by_scan(*args)
expects_array = args.first.kind_of?(Array)
- ids = args.flatten.compact.uniq.map { |arg| arg.to_i }
+ ids = args.flatten.compact.map{ |arg| arg.to_i }.uniq
if ids.size == 1
id = ids.first
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
index 37a9d216df..eb88f191a7 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
@@ -128,10 +128,11 @@ module ActiveRecord
@reserved_connections[current_connection_id] ||= checkout
end
- # Check to see if there is an active connection in this connection
- # pool.
+ # Is there an open connection that is being used for the current thread?
def active_connection?
- active_connections.any?
+ @reserved_connections.fetch(current_connection_id) {
+ return false
+ }.in_use?
end
# Signal that the thread is finished with the current connection.
@@ -288,10 +289,6 @@ module ActiveRecord
end
c
end
-
- def active_connections
- @connections.find_all { |c| c.in_use? }
- end
end
# ConnectionHandler is a collection of ConnectionPool objects. It is used
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb
index 02a7f6af78..6a4f972356 100644
--- a/activerecord/test/cases/associations/has_many_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_associations_test.rb
@@ -378,6 +378,13 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
assert_equal 1, Firm.find(:first, :order => "id").clients_using_sql.size
end
+ def test_finding_using_sql_take_into_account_only_uniq_ids
+ firm = Firm.find(:first, :order => "id")
+ client = firm.clients_using_sql.first
+ assert_equal client, firm.clients_using_sql.find(client.id, client.id)
+ assert_equal client, firm.clients_using_sql.find(client.id, client.id.to_s)
+ end
+
def test_counting_using_sql
assert_equal 1, Firm.find(:first, :order => "id").clients_using_counter_sql.size
assert Firm.find(:first, :order => "id").clients_using_counter_sql.any?
diff --git a/activerecord/test/cases/connection_pool_test.rb b/activerecord/test/cases/connection_pool_test.rb
index 2c69bfde5b..861ae7e120 100644
--- a/activerecord/test/cases/connection_pool_test.rb
+++ b/activerecord/test/cases/connection_pool_test.rb
@@ -3,6 +3,8 @@ require "cases/helper"
module ActiveRecord
module ConnectionAdapters
class ConnectionPoolTest < ActiveRecord::TestCase
+ attr_reader :pool
+
def setup
super
@@ -25,6 +27,57 @@ module ActiveRecord
@pool.disconnect!
end
+ def active_connections(pool)
+ pool.connections.find_all(&:in_use?)
+ end
+
+ def test_released_connection_moves_between_threads
+ thread_conn = nil
+
+ Thread.new {
+ pool.with_connection do |conn|
+ thread_conn = conn
+ end
+ }.join
+
+ assert thread_conn
+
+ Thread.new {
+ pool.with_connection do |conn|
+ assert_equal thread_conn, conn
+ end
+ }.join
+ end
+
+ def test_with_connection
+ assert_equal 0, active_connections(pool).size
+
+ main_thread = pool.connection
+ assert_equal 1, active_connections(pool).size
+
+ Thread.new {
+ pool.with_connection do |conn|
+ assert conn
+ assert_equal 2, active_connections(pool).size
+ end
+ assert_equal 1, active_connections(pool).size
+ }.join
+
+ main_thread.close
+ assert_equal 0, active_connections(pool).size
+ end
+
+ def test_active_connection_in_use
+ assert !pool.active_connection?
+ main_thread = pool.connection
+
+ assert pool.active_connection?
+
+ main_thread.close
+
+ assert !pool.active_connection?
+ end
+
def test_full_pool_exception
assert_raises(PoolFullError) do
(@pool.size + 1).times do
diff --git a/activeresource/CHANGELOG.md b/activeresource/CHANGELOG.md
index f305c3fd4a..670cb19f57 100644
--- a/activeresource/CHANGELOG.md
+++ b/activeresource/CHANGELOG.md
@@ -3,6 +3,11 @@
* Adds support for PATCH requests. *dlee*
+## Rails 3.2.2 (March 1, 2012) ##
+
+* No changes.
+
+
## Rails 3.2.1 (January 26, 2012) ##
* Documentation fixes.
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md
index 09ec4ed618..8165b89cde 100644
--- a/activesupport/CHANGELOG.md
+++ b/activesupport/CHANGELOG.md
@@ -27,6 +27,11 @@
* Unicode database updated to 6.1.0.
+## Rails 3.2.2 (March 1, 2012) ##
+
+* No changes.
+
+
## Rails 3.2.1 (January 26, 2012) ##
* Documentation fixes and improvements.
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb
index d71e3f968f..4544edf0dd 100644
--- a/activesupport/test/core_ext/hash_ext_test.rb
+++ b/activesupport/test/core_ext/hash_ext_test.rb
@@ -490,7 +490,7 @@ class HashExtTest < ActiveSupport::TestCase
original = {:a => 1, :b => 2, :c => 3, :d => 4}
expected = {:a => 1, :b => 2}
- assert_equal expected, {:a => 1, :b => 2, :c => 3, :d => 4}.extract!(:a, :b)
+ assert_equal expected, original.extract!(:a, :b)
end
def test_except
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md
index 960b1ed8ca..e7994e45c6 100644
--- a/railties/CHANGELOG.md
+++ b/railties/CHANGELOG.md
@@ -20,6 +20,11 @@
* Rails::Plugin has gone. Instead of adding plugins to vendor/plugins use gems or bundler with path or git dependencies. *Santiago Pastorino*
+## Rails 3.2.2 (March 1, 2012) ##
+
+* No changes.
+
+
## Rails 3.2.1 (January 26, 2012) ##
* Documentation fixes.