| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
use `secrets.secret_key_base` instead of `config.secret_key_base`
|
| |
| |
| |
| | |
use secrets.yml instead of secret_token.rb
|
| |
| |
| |
| | |
callback and an error happens
|
|\ \
| |/
|/| |
Correct `select` examples and doc, ref [522c0fd] [ci skip]
|
| | |
|
| |
| |
| |
| |
| | |
Fix a few typos. #present_in has been changed to #presence_in through
commit d61baee5.
|
|\ \
| | |
| | | |
`includes` uses SQL parsing when String joins are involved.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is a partial revert of 22b3481ba2aa55fad1f9a5db94072312b345fb55.
The current implementation of `references_eager_loaded_tables?` needs to know
every table involved in the query. With the current API this is not possible
without SQL parsing.
While a2dab46cae35a06fd5c5500037177492a047c252 deprecated SQL parsing for `includes`.
It did not issue deprecation warnings when String joins are involved. This resulted
in a breaking change after the deprecated behavior was removed (22b3481ba2aa55fad1f9a5db94072312b345fb55).
We will need to rethink the usage of `includes`, `preload` and `eager_load` but for now,
this brings back the old *working* behavior.
|
|\ \
| |/
|/| |
Use secrets.yml instead of secret_token.rb in the docs
|
|/
|
|
| |
controller guide
|
|\
| |
| | |
Fix a bug affecting validations of enum attributes
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a bug where any enum attribute of a model
would be evaluated always as 0 when calling the
database on validations.
This fix converts the value of the enum attribute
to its integer value rather than the string before
building the relation as the bug occured when the
string finally gets converted to integer using
string.to_i which converts it to 0.
[Vilius Luneckas, Ahmed AbouElhamayed]
|
|\
| |
| | |
fix test cases
|
| | |
|
| |
| |
| |
| | |
Active Record is specifically for databases. Refs #12101.
|
|\ \
| | |
| | | |
Cache#fetch_multi returns a Hash instead of an Array
|
|/ /
| |
| |
| |
| |
| |
| | |
The current implementation of `fetch_multi` returns an array and has no
means to easily backtrack which names yielded which results. By changing
the return value to a Hash we retain the name information. Hash#values
can be used on the response if only the values are needed.
|
|\ \
| | |
| | | |
[skip ci] Fixes docs typo in nested resource path helpers
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Now that Validator #setup is called from the initializer, we need a
reference to the model's class to be passed in to allow the validators
to continue functioning when used at the instance level.
Closes #14134.
|
|/ /
| |
| |
| |
| | |
Goes along with fea1cdcff4d50d302d8e8532432c3ab107ff816d and
59ec4562a2e70df455b2e44a67c340fa5254e26e.
|
|\ \
| | |
| | | |
Fix controller test not resetting @_url_options
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Commit 4f2cd3e9 introduced a bug by reordering the call to
`@controller.recycle!` above the call to `build_request_uri`. The
impact of this was that the `@_url_options` cache ends up not being
reset between building a request URI (occurring within the test
controller) and the firing of the actual request.
We encountered this bug because we had the following setup:
class MinimumReproducibleController < ActionController::Base
before_filter { @param = 'param' }
def index
render text: url_for(params)
end
def default_url_options
{ custom_opt: @param }
end
end
def test_index
get :index # builds url, then fires actual request
end
The first step in `get :index` in the test suite would populate the
@_url_options cache. The subsequent call to `url_for` inside of the
controller action would then utilize the uncleared cache, thus never
calling the now-updated default_url_options.
This commit fixes this bug calling recycle! twice, and removes a call
to set response_body, which should no longer be needed since we're
recycling the request object explicitly.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Benchmark:
Benchmark.ips do |x|
x.report("home") { "home".underscore }
x.report("Home") { "Home".underscore }
x.report("homeBase") { "homeBase".underscore }
x.report("home::base") { "home::base".underscore }
end
Before:
Calculating -------------------------------------
home 2598 i/100ms
Home 2463 i/100ms
homeBase 2300 i/100ms
home::base 2086 i/100ms
-------------------------------------------------
home 28522.3 (±14.7%) i/s - 140292 in 5.065102s
Home 29165.8 (±14.9%) i/s - 140391 in 5.000475s
homeBase 26218.5 (±7.1%) i/s - 131100 in 5.030485s
home::base 27712.3 (±5.9%) i/s - 139762 in 5.064077s
After:
Calculating -------------------------------------
home 23163 i/100ms
Home 2432 i/100ms
homeBase 2160 i/100ms
home::base 2265 i/100ms
-------------------------------------------------
home 1501614.8 (±10.2%) i/s - 7412160 in 5.009540s
Home 28754.0 (±8.5%) i/s - 143488 in 5.033886s
homeBase 25331.1 (±5.6%) i/s - 127440 in 5.047940s
home::base 27089.9 (±5.5%) i/s - 135900 in 5.033516s
|
| | |
| | |
| | |
| | | |
We should not rely on to_s to return the name of the class
|
|\ \ \
| |/ /
|/| | |
[ci skip] Update list of files extensions in rake notes guide
|
|/ / |
|
|\ \
| | |
| | | |
[ci skip] Move association class method notes
|
| | |
| | |
| | |
| | | |
Make explanation of association class methods clearer by moving notes to beginning of each example section.
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
[ci skip] remove guide section on models in migrations [ci skip]
|
|/ / /
| | |
| | |
| | |
| | |
| | | |
Both examples given are incorrect, and no one can seem to come up with
a realistic situation where this is an actual problem. For now, it seems like
the best thing to do is just scrap the section altogether.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This test currently outputs the following warning:
```
unknown OID: current_mood(3567879) (SELECT "postgresql_enums".* FROM "postgresql_enums" ORDER BY "postgresql_enums"."id" ASC LIMIT 1)
unknown OID: current_mood(3567879) (SELECT "postgresql_enums".* FROM "postgresql_enums" WHERE "postgresql_enums"."id" = $1 LIMIT 1)
```
We have an open PR to deal with this issue. It will dynamically
register the OID for enum columns. This test case is merely to exhibit
the current behavior of PostgreSQL enum columns.
|
|\ \ \
| | | |
| | | | |
Bump version of bcrypt gem
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
From #14026:
Specific rbx-2 to limit testing on Rubinius 2.x (since there will be
other versions of Rubinius > 2.x soon).
Also, as of Rubinius 2.2.5, it is no longer necessary to bundle the
rubysl gem.
This is what Rails master/4.1 supports, so we don't need to add rubysl to
gemfiles anymore.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
`before_add` callbacks are fired before the record is saved on
`has_and_belongs_to_many` assocations *and* on `has_many :through`
associations. Before this change, `before_add` callbacks would be fired
before the record was saved on `has_and_belongs_to_many` associations, but
*not* on `has_many :through` associations.
Fixes #14144
|
|\ \ \ \
| | | | |
| | | | | |
Fix test name typo in app generator tests.
|
| | | | | |
|
|\ \ \ \ \
| |/ / / /
|/| | | |
| | | | |
| | | | |
| | | | |
| | | | | |
'chancancode/fix_instance_method_already_implemented'
Conflicts:
activerecord/CHANGELOG.md
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
conflicting private method defined on its ancestors.
The problem is that `method_defined_within?(name, klass, superklass)`
only works correclty when `klass` and `superklass` are both `Class`es.
If both `klass` and `superklass` are both `Class`es, they share the
same inheritance chain, so if a method is defined on `klass` but not
`superklass`, this method must be introduced at some point between
`klass` and `superklass`.
This does not work when `superklass` is a `Module`. A `Module`'s
inheritance chain contains just itself. So if a method is defined on
`klass` but not on `superklass`, the method could still be defined
somewhere upstream, e.g. in `Object`.
This fix works by avoiding calling `method_defined_within?` with a
module while still fufilling the requirement (checking that the
method is defined withing `superclass` but not is not a generated
attribute method).
4d8ee288 is likely an attempted partial fix for this problem. This
unrolls that fix and properly check the `superclass` as intended.
Fixes #11569.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
travis s/2.1.0/2.1.1
|
|/ / / / / |
|
|\ \ \ \ \
| |_|/ / /
|/| | | |
| | | | |
| | | | | |
schneems/schneems/fix-ar-wtf-why-is-there-no-environment
Handle missing environment from non empty config
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
If using a `DATABASE_URL` and a `database.yml`. The connection information in `DATABASE_URL` should be merged into whatever environment we are in. As released in 4.1.0rc1 if someone has a database.yml but is missing a key like production:
```yml
development:
host: localhost
```
Then the check for blank config will return false so the information from the `DATABASE_URL` will not be used when attempting to connect to the `production` database and the connection will incorrectly fail.
This commit fixes this problem and adds a test for the behavior.
In addition the ability to specify a connection url in a `database.yml` like this:
```
production: postgres://localhost/foo
```
Was introduced in 4.1.0rc1 though should not be used, instead using a url sub key
```
production:
url: postgres://localhost/foo
```
This url sub key was also introduced in 4.1.0rc1 though the `production: postgres://localhost/foo` was not removed. As a result we should not test this behavior.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Skip test_migrate_revert_add_index_with_name for some databases
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
do not allow to create duplicate indexes on the same columns
|