| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| | |
Simplify code by taking advantage of latest mocha (v0.13.0).
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This only works with mocha v0.13.0 or later.
Note that this also fixes a few subtle bugs present in the current
implementation :-
* Mocha was raising a `MiniTest::Assertion` instead of a
`Mocha::ExpectationError` as intended. The latter is not recognized by
MiniTest as an assertion failure and so it is recorded as a test
*error*, not a test *failure* as it ought to. This leads to
potentially confusing output in the test results.
* Mocha verification should happen as part of the test. The verification
of expectations is equivalent to a set of assertions. These assertions
should happen as *part of* the test so that they have a chance to
cause the test to fail, and not just as part of the teardown. Also if
an assertion fails during the test, then there is no need to verify
expectations, because only the first assertion failure is normally
reported and all subsequent bets are off.
* Expectation verification should be counted as an assertion. Mocha
cannot record each expectation verification as an assertion, because
we weren't passing in an assertion counter to `#mocha_verify`.
|
| |
| |
| |
| | |
this file with us-ascii
|
|\ \
| | |
| | | |
`#as_json` isolates options when encoding a hash. Closes #8182
|
| |/
| |
| |
| |
| |
| | |
Setting options in a custom `#as_json` method had side effects.
Modifications of the `options` hash leaked outside and influenced
the conversion of other objects contained in the hash.
|
| | |
|
| |
| |
| |
| |
| | |
voloko/sdoc seems to be maintained again, in particular
the issues that made us fork it are resolved.
|
|\ \
| | |
| | | |
Merge and add tests related to #5215
|
| |/ |
|
|/ |
|
|
|
|
|
| |
Thanks @toretore.
https://github.com/rails/rails/commit/9e4c41c903e8e58721f2c41776a8c60ddba7a0a9#commitcomment-2134706
|
|\
| |
| | |
Match classes without to_s conversions.
|
| |
| |
| |
| | |
There is no need in `value_under_case.class.to_s` conversion since case already matches classes with `Class === value_under_case`.
|
|\ \
| | |
| | | |
Test Hash#diff deprecation, also prevent deprecation message in AS tests
|
| |/ |
|
|\ \
| |/
|/| |
Removing warning : ambiguous first argument
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Two threads may be in method_missing at the same time. If so, they might
both try to define the same delegator method.
Such a situation probably wouldn't result in a particularly spectacular
bug as one method would probably just be overridden by an identical
method, but it could cause warnings to pop up. (It could be worse if
method definition is non-atomic in a particular implementation.)
(We will also need this mutex shortly anyway, see #8127.)
|
| |
|
| |
|
|\
| |
| | |
Removing warning : assigned but unused variable
|
| | |
|
|\ \
| | |
| | | |
Remove unwanted transaction when has one association is built
|
|/ / |
|
|\ \
| |/
|/| |
Keep the code related to serialization in Serialization module.
|
|/
|
|
| |
We should not need any `serialized_attributes` checks outside `ActiveRecord::AttributeMethods::Serialization` module.
|
|\
| |
| | |
Trivial documentation fix for ActiveModel::Naming comment [ci skip]
|
|/ |
|
|
|
|
|
|
|
| |
get is the most common usage, and match without an explicit verb
was disallowed in 56cdc81c08b1847c5c1f699810a8c3b9ac3715a6.
[ci skip]
|
|
|
|
|
|
|
|
| |
Most apps upgrading from 3.x will have options for mass assigment in
their application.rb and environments/*.rb config files. Rather than
just raising a NoMethodError when copying the config, this commit
adds a warning message until either the protected_attributes gem
is installed or the relevant config options are removed.
|
|\
| |
| | |
Deprecate Hash#diff.
|
| |
| |
| |
| |
| |
| | |
It's no longer used in Rails any more.
See https://github.com/rails/rails/pull/8142\#issuecomment-10227297 for more
|
| |
| |
| |
| |
| | |
These were removed with ActiveRecord::Model in
https://github.com/rails/rails/commit/9e4c41c903e8e58721f2c41776a8c60ddba7a0a9#L15L156
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Rather than just changing it and hoping for the best.
Requested by @jeremy:
https://github.com/rails/rails/commit/ba1544d71628abff2777c9c514142d7e9a159111#commitcomment-2106059
|
|\ \
| | |
| | | |
Removing duplication in callback normalization.
|
| |/
| |
| |
| | |
These two things were 100% identical.
|
|\ \
| | |
| | | |
:counter_cache option for to support custom named counter caches
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
So that the scope may be a NullRelation and return a result without
executing a query.
Fixes #7928
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Fixes #8102.
I couldn't find a nicer way to deal with this than delegate the call to
#scope, which will be a NullRelation when we want it to be.
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This allows us to avoid hacks like the "return 0 if owner.new_record?"
in #count (which this commit removes).
Also, the relevant foreign key may actually be present even on a new
owner record, in which case we *don't* want a null relation. This logic
is encapsulated in the #null_scope? method.
We also need to make sure that the CollectionProxy is not 'infected'
with the NullRelation module, or else the methods from there will
override the definitions in CollectionProxy, leading to incorrect
results. Hence the nullify: false option to CollectionAssociation#scope.
(This feels a bit nasty but I can't think of a better way.)
|
|\ \
| | |
| | | |
delegate PathSet's enumerator methods
|
| | | |
|
|\ \ \
| | | |
| | | | |
Fix message about include_blank option. [ci skip]
|
| | | |
| | | |
| | | |
| | | |
| | | | |
See
https://github.com/rails/rails/commit/cb7d19b66badfbd1846c195913419c331701074e#commitcomment-2127148.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
null relations
For example, the following should not run any query on the database:
Post.new.comments.where(body: 'omg').to_a # => []
Fixes #5215.
|
|\ \ \ \
| |/ / /
|/| | | |
Add note about squashing in contributor guide.
|
|/ / /
| | |
| | |
| | |
| | | |
We tell people how to do this all the time in the Issues tracker,
so now we can just point them here.
|