diff options
Diffstat (limited to 'activerecord/CHANGELOG')
-rw-r--r-- | activerecord/CHANGELOG | 147 |
1 files changed, 145 insertions, 2 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index 502a7e43de..871cc624ca 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,4 +1,148 @@ -*Rails 3.1.0 (unreleased)* +*Rails 3.2.0 (unreleased)* + +* In development mode the db:drop task also drops the test database. For symmetry with + the db:create task. [Dmitriy Kiriyenko] + +* Added ActiveRecord::Base.store for declaring simple single-column key/value stores [DHH] + + class User < ActiveRecord::Base + store :settings, accessors: [ :color, :homepage ] + end + + u = User.new(color: 'black', homepage: '37signals.com') + u.color # Accessor stored attribute + u.settings[:country] = 'Denmark' # Any attribute, even if not specified with an accessor + + +* MySQL: case-insensitive uniqueness validation avoids calling LOWER when + the column already uses a case-insensitive collation. Fixes #561. + + [Joseph Palermo] + +* Transactional fixtures enlist all active database connections. You can test + models on different connections without disabling transactional fixtures. + + [Jeremy Kemper] + +* Add first_or_create, first_or_create!, first_or_initialize methods to Active Record. This is a + better approach over the old find_or_create_by dynamic methods because it's clearer which + arguments are used to find the record and which are used to create it: + + User.where(:first_name => "Scarlett").first_or_create!(:last_name => "Johansson") + + [Andrés Mejía] + +* Fix nested attributes bug where _destroy parameter is taken into account + during :reject_if => :all_blank (fixes #2937) + + [Aaron Christy] + +*Rails 3.1.2 (unreleased)* + +* Fix bug where building the conditions of a nested through association could potentially + modify the conditions of the through and/or source association. If you have experienced + bugs with conditions appearing in the wrong queries when using nested through associations, + this probably solves your problems. [GH #3271] + + [Jon Leighton] + +* If a record is removed from a has_many :through, all of the join records relating to that + record should also be removed from the through association's target. + + [Jon Leighton] + +* Fix adding multiple instances of the same record to a has_many :through. [GH #3425] + + [Jon Leighton] + +* Fix creating records in a through association with a polymorphic source type. [GH #3247] + + [Jon Leighton] + +*Rails 3.1.1 (October 7, 2011)* + +* Add deprecation for the preload_associations method. Fixes #3022. + + [Jon Leighton] + +* Don't require a DB connection when loading a model that uses set_primary_key. GH #2807. + + [Jon Leighton] + +* Fix using select() with a habtm association, e.g. Person.friends.select(:name). GH #3030 and + #2923. + + [Hendy Tanata] + +* Fix belongs_to polymorphic with custom primary key on target. GH #3104. + + [Jon Leighton] + +* CollectionProxy#replace should change the DB records rather than just mutating the array. + Fixes #3020. + + [Jon Leighton] + +* LRU cache in mysql and sqlite are now per-process caches. + + * lib/active_record/connection_adapters/mysql_adapter.rb: LRU cache + keys are per process id. + * lib/active_record/connection_adapters/sqlite_adapter.rb: ditto + + [Aaron Patterson] + +* Support bulk change_table in mysql2 adapter, as well as the mysql one. [Jon Leighton] + +* If multiple parameters are sent representing a date, and some are blank, the +resulting object is nil. In previous releases those values defaulted to 1. This +only affects existing but blank parameters, missing ones still raise an error. +[Akira Matsuda] + +* ActiveRecord::Base.establish_connection now takes a string that contains +a URI that specifies the connection configuration. For example: + + ActiveRecord::Base.establish_connection 'postgres://localhost/foo' + +* Active Record's dynamic finder will now raise the error if you passing in less number of arguments than what you call in method signature. + + So if you were doing this and expecting the second argument to be nil: + + User.find_by_username_and_group("sikachu") + + You'll now get `ArgumentError: wrong number of arguments (1 for 2).` You'll then have to do this: + + User.find_by_username_and_group("sikachu", nil) + + [Prem Sichanugrist] + + +*Rails 3.1.0 (August 30, 2011)* + +* Add a proxy_association method to association proxies, which can be called by association + extensions to access information about the association. This replaces proxy_owner etc with + proxy_association.owner. + + [Jon Leighton] + +* ActiveRecord::MacroReflection::AssociationReflection#build_record has a new method signature. + + Before: def build_association(*options) + After: def build_association(*options, &block) + + Users who are redefining this method to extend functionality should ensure that the block is + passed through to ActiveRecord::Base#new. + + This change is necessary to fix https://github.com/rails/rails/issues/1842. + + [Jon Leighton] + +* AR#pluralize_table_names can be used to singularize/pluralize table name of an individual model: + + class User < ActiveRecord::Base + self.pluralize_table_names = false + end + + Previously this could only be set globally for all models through ActiveRecord::Base.pluralize_table_names. [Guillermo Iguaran] * Add block setting of attributes to singular associations: @@ -232,7 +376,6 @@ def up create_table :posts do |t| t.belongs_to :user - t.timestamps end |