This commit allows Relation#where with no arguments to be chained
with new inequality query methods greater_than, greater_than_or_equal,
less_than, and less_than_or_equal, also aliased as gt, gte, lt,
and lte.
This commit stems from https://github.com/rails/rails/pull/8332#issuecomment-11127957
Since the formats in which conditions can be passed to not differ
from the formats in which conditions can be passed to like and not_like,
then …
This issue was raised in #8448 and caused by an earlier PR #8048. Previously the return value form the mailer methods was used to determine if mail() was called. This led to bugs when mail() was not the last call in the mailer method…
This commit fixes issue #8446 in which false positive detection of counter_cache columns causes inconsistent behaviour in has_many associations.
The approach used here is to query the belongs_to side of an association to discover…
This commit updates the rdoc of AR#where to match the changes applied
in https://github.com/rails/rails/commit/6ba0f97 that is:
where(nil) has the same effect of where(''): a no opwhere (no args) has the same effect of `where…It was pointed out by @giner that the CHANGELOG entry for https://github.com/rails/rails/commit/78d5d6f8688bb7c45ba9a3ef893682231130da3f
wasn't included. Here it is.
When I help newcomers to Rails with Associations I often find they forget to build in the foreign key in their migrations. I'm wondering if it would be helpful to include example migrations for each type of association. I know the images…
As of Turbolinks 0.6.1, the turbolinks script doesn't need to be last in the manifest.
Reverts the change made in #8411.
Sometimes, on Mac OS X, programmers accidentally press Option+Space
rather than just Space and don’t see the difference. The problem is
that Option+Space writes a non-breaking space (0XA0) rather than a
normal space (0x20).
This commit …
According to the documentation, css_select can only accept either
one or two arguments.
In the first case, the argument is always a string.
For instance: css_select("div")
In the second case, the last argument is always a string.
F…
This is a backport of #8403.
It fixes the issue described in #3313
Conflicts:
activerecord/CHANGELOG.md
activerecord/test/models/developer.rb
I had to make some modifications to the spec because the API changed in 4.0.
Turbolinks should be located at the bottom of application.js to detect assets change properly.
ActiveModel::SecurePassword currently has a class method #min_cost that is used to set a boolean value to change the cost factor of bcrypt-ruby to either 4 (MIN_COST of bcrypt-ruby) or 10 (DEFAULT in bcrypt-ruby).
If you want to have mo…
ruby-2.0.0preview2 or later changed Object#initialize_dup to private method. I fixed Object#respond_to? works with private method.
There are eager-loading queries that Active Record performs in two steps.
Currently step one also instantiated intermediate ActiveRecord obj…
This change was motivated by the stack trace from #8376. The error describes the problem poorly. Since calling render with :layout => true is valid for templates, I can see beginners making the mistake to make such a call to render a…
This commit fixes reported issue #7630 in which counter caches were not being updated properly when replacing has_many_through relationships.
eg if posts have many tags through `taggings…