diff options
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 129 |
1 files changed, 117 insertions, 12 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 0c8c8c006e..aa156f5d4f 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,41 +1,146 @@ ## Rails 4.0.0 (unreleased) ## -* Allow ActiveRecord::Base.connection_handler to have thread affinity and be - settable, this effectively allows ActiveRecord to be used in a multi threaded +* Added Statement Cache to allow the caching of a single statement. The cache works by + duping the relation returned from yielding a statement, which allows skipping the AST + building phase for following executes. The cache returns results in array format. + + Example: + + cache = ActiveRecord::StatementCache.new do + Book.where(name: "my book").limit(100) + end + + books = cache.execute + + The solution attempts to get closer to the speed of `find_by_sql` but still maintaining + the expressiveness of the Active Record queries. + + *Olli Rissanen* + +* Preserve context while merging relations with join information. + + class Comment < ActiveRecord::Base + belongs_to :post + end + + class Author < ActiveRecord::Base + has_many :posts + end + + class Post < ActiveRecord::Base + belongs_to :author + has_many :comments + end + + `Comment.joins(:post).merge(Post.joins(:author).merge(Author.where(:name => "Joe Blogs"))).all` + would fail with + `ActiveRecord::ConfigurationError: Association named 'author' was not found on Comment`. + + It is failing because `all` is being called on relation which looks like this after all + the merging: `{:joins=>[:post, :author], :where=>[#<Arel::Nodes::Equality: ....}`. In this + relation all the context that `Post` was joined with `Author` is lost and hence the error + that `author` was not found on `Comment`. + + Ths solution is to build JoinAssociation when two relations with join information are being + merged. And later while building the arel use the previously built `JoinAssociation` record + in `JoinDependency#graft` to build the right from clause. + + Fixes #3002. + + *Jared Armstrong and Neeraj Singh* + +* `default_scopes?` is deprecated. Check for `default_scopes.empty?` instead. + + *Agis Anastasopoulos* + +* Default values for PostgreSQL bigint types now get parsed and dumped to the + schema correctly. + + *Erik Peterson* + +* Fix associations with `:inverse_of` option when building association + with a block. Inside the block the parent object was different then + after the block. + + Example: + + parent.association.build do |child| + child.parent.equal?(parent) # false + end + + # vs + + child = parent.association.build + child.parent.equal?(parent) # true + + *Michal Cichra* + +* `has_many` using `:through` now obeys the order clause mentioned in + through association. Fixes #10016. + + *Neeraj Singh* + +* `belongs_to :touch` behavior now touches old association when + transitioning to new association. + + class Passenger < ActiveRecord::Base + belongs_to :car, touch: true + end + + car_1 = Car.create + car_2 = Car.create + + passenger = Passenger.create car: car_1 + + passenger.car = car_2 + passenger.save + + Previously only car_2 would be touched. Now both car_1 and car_2 + will be touched. + + *Adam Gamble* + +* Extract and deprecate Firebird / Sqlserver / Oracle database tasks, because + These tasks should be supported by 3rd-party adapter. + + *kennyj* + +* Allow `ActiveRecord::Base.connection_handler` to have thread affinity and be + settable, this effectively allows Active Record to be used in a multi threaded setup with multiple connections to multiple dbs. *Sam Saffron* -* `rename_column` preserves auto_increment in mysql migrations. +* `rename_column` preserves `auto_increment` in MySQL migrations. Fixes #3493. *Vipul A M* -* PostgreSQL geometric type point is supported by ActiveRecord. Fixes #7324. +* PostgreSQL geometric type point is now supported by Active Record. Fixes #7324. *Martin Schuerrer* * Add support for concurrent indexing in PostgreSQL adapter via the - `algorithm: :concurrently` option + `algorithm: :concurrently` option. add_index(:people, :last_name, algorithm: :concurrently) - Also adds support for MySQL index algorithms (`COPY`, `INPLACE`, - `DEFAULT`) via the `algorithm: :copy` option + Also add support for MySQL index algorithms (`COPY`, `INPLACE`, + `DEFAULT`) via the `:algorithm` option. add_index(:people, :last_name, algorithm: :copy) # or :inplace/:default *Dan McClain* -* Add support for fulltext and spatial indexes on MySQL tables with MyISAM database - engine via the `type: 'FULLTEXT'` / `type: 'SPATIAL'` option +* Add support for fulltext and spatial indexes on MySQL tables with MyISAM database + engine via the `type: 'FULLTEXT'` / `type: 'SPATIAL'` option. add_index(:people, :last_name, type: 'FULLTEXT') add_index(:people, :last_name, type: 'SPATIAL') *Ken Mazaika* -* Add an `add_index` override in Postgresql adapter and MySQL adapter +* Add an `add_index` override in PostgreSQL adapter and MySQL adapter to allow custom index type support. Fixes #6101. add_index(:wikis, :body, :using => 'gin') @@ -1799,13 +1904,13 @@ add_index(:accounts, :code, where: 'active') - Generates + generates CREATE INDEX index_accounts_on_code ON accounts(code) WHERE active *Marcelo Silveira* -* Implemented ActiveRecord::Relation#none method. +* Implemented `ActiveRecord::Relation#none` method. The `none` method returns a chainable relation with zero records (an instance of the NullRelation class). |