This is a redo of #18173, with the change made against the master branch, as requested by @sgrif.
Before Rails 4.2.0, model_path("id" => 1) would work fine. As of Rails 4.2.0, it generates a couple of errors:
All cases are properly handled in CollectionAssociation for all subclasses of this association.
I was trying to investigate the issue fixed in https://github.com/rails/rails/commit/f045663dfc879b9516904255fb555f048c394b7b in 4.1 stabl…
Before Rails 4.2.0, model_path("id" => 1) would work fine. As of Rails 4.2.0, it generated a couple of errors:
Backport https://github.com/rails/rails/pull/18157 to 4-2-stable.
NOTE: this is a severe app-crashing regression from 4.1.8 to 4.2.0. The fix should be trivial to backport to 4-2-stable.
The code in ConnectionPool#release assumed that a single thread only
ever holds a single connection, and thus …
Update the docs to more accurately describe how the Active Record attribute query methods behave (applicable code here).
Currently out-of-range user-entered datetimes cause an argument error:
task = Task.new(start_at: "2014-07-01T24:59:59GMT") #=> ArgumentError
In contrast, when really bad data is entered the error is caught and the…
This commit intends to clarify the scope of ActionView::RecordIdentifier
methods dom_id and dom_class.
Most of the current documentation comes from da257eb8 (7 years ago) when
the decoupling of ActionView, ActiveRecord and Activ…
When same association is loaded in the model creation callback
The new object is inserted into association twice.
Car.has_many :bulbs
Bulb.belongs_to :car
Bulb.after_create do |record|
record.car.bulbs.to_a # force loa...
Add support for creating and dropping views. In a migration, a view can be created using a rails relation or literal sql
create_view :posts_commented_by_staff, Post.joins(comment: user).where(users: {role: 'staff'}).uniq
cr...
This commit intends to clarify the scope of ActionView::RecordIdentifier methods dom_id and dom_class.
Most of the current documentation comes from da257eb8 (7 years ago) when the decoupling of ActionView, ActiveRecord and ActiveM…
The Sheep fixture was added in eb23754e when moving template tests
from actionpack to actionview, but it's not actually used in ActionView tests.
The Sheep fixture is only used to test uncountable in ActiveModel tests,
and [is…
Update the docs to mention a potential gotcha when checking for the presence of a boolean value with Active Record's attribute query method.
rake test_mysql works, make theNo need to point links to http://guides.rubyonrails.org/v4.2.0/… now
that the Ruby on Rails guides point to 4.2.0.
Closes #15853
I changed join_dependency to pass test in 5706d290b0a2501a713fadfb76d9e45c24d26e6a.
@senny Please check this PR.
I've written following code many times.
Model.record_timestamps = false
@model.update(foo: bar)
Model.record_timestamps = true
It's very boring to write, so I added skip_timestamps. With the method, you can write:
…
Closes #17945
There are environments (like Heroku) where it's not possible to purge a database. This rendered db:schema:load and db:structure:load useless in such circumstances.
The original behavior (until Rails 4.0) was as …
Document test_order and test_order= from ActiveSupport::TestCase.
[ci skip]
The reason why I'm opening this PR on rails/rails rather than pushing to [rails/docrails](https://github.com…