diff options
Diffstat (limited to 'activerecord/CHANGELOG.md')
-rw-r--r-- | activerecord/CHANGELOG.md | 118 |
1 files changed, 111 insertions, 7 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index c6ce77a9cc..52300fd53f 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,13 +1,117 @@ ## Rails 4.0.0 (unreleased) ## +* `0x` prefix must be added when assigning hexadecimal string into `bit` column in PostgreSQL. + + *kennyj* + +* 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`. + + The 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. + settable, this effectively allows Active Record to be used in a multithreaded + setup with multiple connections to multiple databases. *Sam Saffron* @@ -41,7 +145,8 @@ *Ken Mazaika* * Add an `add_index` override in PostgreSQL adapter and MySQL adapter - to allow custom index type support. Fixes #6101. + to allow custom index type support. + Fixes #6101. add_index(:wikis, :body, :using => 'gin') @@ -65,7 +170,6 @@ in the association for a particular id. Then, it will go to the DB if it is not found. This is accomplished by calling `find_by_scan` in collection associations whenever `options[:inverse_of]` is not nil. - Fixes #9470. *John Wang* @@ -1175,7 +1279,7 @@ * Explain only normal CRUD sql (select / update / insert / delete). Fix problem that explains unexplainable sql. - Closes #7544 #6458. + Fixes #7544 #6458. *kennyj* @@ -1804,13 +1908,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). |