| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
do not allow to create duplicate indexes on the same columns
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The Ruby Range object does not support excluding beginnings.
We currently support excluding beginnings for some subtypes using
manually by incrementing them (now using the `#succ` method).
This is approach is flawed as it's not equal to an excluding beginning.
This commit deprecates the current support for excluding beginnings.
It also raises an `ArgumentError` for subtypes that do not implement the `succ`
method.
This is a temporary solution to get rid of the broken state. We might still
add complete support for excluding beginnings afterwards. (Probably with a
new `PGRange` object, which acts like a `Range` but has excluding beginnings.
|
| |
| |
| |
| |
| |
| |
| |
| | |
This gets AR working with custom defined range types. It also
removes the need for subtype specific branches in `OID::Range`.
This expands the interface of all `OID` types with the `infinity` method.
It's responsible to provide a value for positive and negative infinity.
|
|/
|
|
| |
See #13875
|
| |
|
|
|
|
| |
This reverts commit 5e3d466d52fa4e9a42c3a1f8773a7c31da875e48.
|
|
|
|
| |
[related #14116]
|
|\
| |
| |
| |
| |
| | |
Conflicts:
actionview/CHANGELOG.md
activerecord/CHANGELOG.md
|
| |
| |
| |
| |
| |
| | |
Thanks Godfrey Chan for reporting this!
Fixes: CVE-2014-0080
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This reverts commit 3ea840355409dc205a9e0d027fc09f1452636969, reversing
changes made to e4cde5d58cbb09d1843796f96ba86225ff94fe05.
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/relation/query_methods.rb
Reason: using `from` without `select` should not change the select list
to SELECT * because it can lead different query results. If it is needed
to change the table to a subquery or a view you can pass a table alias
in the `from` call or use `select('subquery.*')`.
Fixes #14049.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We didn't have enough encoding for the wire protocol to store an array
of hstore types. So, further encode any hstore that is an array member.
Whilst we're here, ensure it's an HashWithIndifferentAccess being
returned, to be consistent with other serialized forms, and add testing
for arrays of hstore.
So now the following migration:
enable_extension "hstore"
create_table :servers do |t|
t.string :name
t.hstore :interfaces, array: true
end
produces a model that can used like this, to store an array of hashes:
server = Server.create(name: "server01", interfaces: [
{ name: "bge0", ipv4: "192.0.2.2", state: "up" },
{ name: "de0", state: "disabled", by: "misha" },
{ name: "fe0", state: "up" },
])
More at http://inopinatus.org/2013/07/12/using-arrays-of-hstore-with-rails-4/
|
| |
| |
| |
| |
| | |
AssociationScope no longer maintains state, so we're safe to keep a
singleton and save on GC time
|
| | |
|
| | |
|
|\ \
| | |
| | |
| | |
| | | |
hdabrows/drop-correct-index-when-reverting-migration
Drop the correct index after reverting a migration
|
| | |
| | |
| | |
| | |
| | |
| | | |
Previously when reverting a migration which added a named index it
would instead drop a corresponding index with matching columns but
without a name.
|
| | |
| | |
| | |
| | |
| | | |
remove created state after test execution, not before the next test.
This prevents the leak of the `ex` table outside of a single test.
|
|/ /
| |
| |
| | |
This should make it harder to accidentally break this test.
|
| | |
|
| |
| |
| |
| | |
check it is handles empty statement
|
|\ \
| | |
| | | |
Reaper has access to threadsafe active? call
|
| | | |
|
|\ \ \
| | | |
| | | | |
context in validation goes through has many relationship
|
| | | | |
|
| |/ /
|/| | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It should not save the parent record when the nested attributes are
invalid.
Test case to cover #8194.
|
|/ /
| |
| |
| |
| |
| | |
If the test is run in a timezone that is behind UTC it fails because
the time generated is ahead of 0000-01-01 00:00:00. Just increase the
time subtracted so that timezone has no effect.
|
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Fixed typos in column_definition_test.rb.
|
| | | |
|
|/ /
| |
| |
| |
| | |
This behavior was introduced since Rails 3.1 (207f266ccaaa9cd04cd2a7513ae5598c4358b510)
but the docs were still out of date.
|
|\ \
| | |
| | | |
Make sure transaction state resets after commit
|
| | |
| | |
| | |
| | | |
[fixes #12566]
|
|\ \ \
| |/ /
|/| |
| | |
| | | |
Fortisque/kevin/active_record_HABTM_with_belongs_to
destruction errors out on HABTM w/out primary key
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
PostgreSQL implementation of SchemaStatements#index_name_exists?
Conflicts:
activerecord/CHANGELOG.md
|
| | | | |
|
| |/ /
|/| | |
|
|\ \ \
| | | |
| | | | |
Associations now raises `ArgumentError` on name conflicts. Closes #13217.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Dangerous association names conflicts include instance or class
methods already defined by `ActiveRecord::Base`.
|
|/ / / |
|
|\ \ \
| | | |
| | | | |
Let `unscope` ignore non Arel scope.where_values
|