| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
because it is only used in
`activerecord/test/cases/adapters/oracle/synonym_test.rb`
See rails/rails#13054
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
map to integers in the database, but can be queried by name
|
|
|
|
|
|
|
|
|
|
|
| |
Currently `scope_chain` uses same array for building different
`scope_chain` for different associations. During processing
these arrays are sometimes mutated and because of in-place
mutation the changed `scope_chain` impacts other reflections.
Fix is to dup the value before adding to the `scope_chain`.
Fixes #3882.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
According to
https://github.com/rails/rails/blob/b601399b72ab56cc01368f02615af99f45d1
4f02/activerecord/lib/active_record/counter_cache.rb#L14, u can pass
more then one association to the `reset_counters` method.
|
| |
|
|
|
|
| |
enum includes text or blob or ... hooked by wrong regex
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
PR #5210 added a Friendship model to illustrate a bug, but in doing so
created a confusing structure because both belongs_to declarations in
Friendship referred to the same side of the join. The new structure
maintains the integrity of the bug test while changing the follower
relationship to be more useful for other testing.
|
|\
| |
| | |
test case for `serialize` default values.
|
| |
| |
| |
| | |
Closes #9110
|
|\ \
| |/
|/|
| |
| |
| |
| | |
cache_key consults updated_on timestamp if present
Conflicts:
activerecord/CHANGELOG.md
|
| |
| |
| |
| |
| | |
- Extract max timestamp retrieval for cache_key
- Update changelog for cache_key changes
|
| |
| |
| |
| |
| | |
This reverts commit 408227d9c5ed7de26310d72a1a99c1ee02311c63, reversing
changes made to dca0b57d03deffc933763482e615c3cf0b9a1d97.
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This caused a bug with the new associations implementation, because now
association conditions are represented as Arel nodes internally right up
to when the whole thing gets turned to SQL.
In Rails 3.2, association conditions get turned to raw SQL early on,
which prevents Relation#merge from interfering.
The current implementation was buggy when a default_scope existed on the
target model, since we would basically end up doing:
default_scope.merge(association_scope)
If default_scope contained a where(foo: 'a') and association_scope
contained a where(foo: 'b').where(foo: 'c') then the merger would see
that the same column is representated on both sides of the merge and
collapse the wheres to all but the last: where(foo: 'c')
Now, the RHS of the merge is left alone.
Fixes #8990
|
|
|
|
| |
Travis only has PostgreSQL 9.1.x but 9.2 is required for range datatypes.
|
| |
|
| |
|
|
|
|
| |
Fix #8575
|
| |
|
|
|
|
|
|
| |
Conflicts:
activerecord/test/models/bulb.rb
activerecord/test/schema/schema.rb
|
| |
|
|
|
|
|
| |
This table is being used to verify if the :limit options is being
ignored for text and binary columns
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
In the end I think the pain of implementing this seamlessly was not
worth the gain provided.
The intention was that it would allow plain ruby objects that might not
live in your main application to be subclassed and have persistence
mixed in. But I've decided that the benefit of doing that is not worth
the amount of complexity that the implementation introduced.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PostgreSQL adapter properly parses default values when using multiple
schemas and domains.
When using domains across schemas, PostgresSQL prefixes the type of the
default value with the name of the schema where that type (or domain) is.
For example, this query:
```
SELECT a.attname, d.adsrc
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = "defaults"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum;
```
could return something like "'<default_value>'::pg_catalog.text" or
"(''<default_value>'::pg_catalog.text)::text" for the text columns with
defaults.
I modified the regexp used to parse this value so that it ignores
anything between ':: and \b(?:character varying|bpchar|text), and it
allows to have optional parens like in the above second example.
|
|
|
|
|
| |
The counter column name in the intermediate model need to be access
via the through reflection.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allows you to specify the model association key in a belongs_to
relationship instead of the foreign key.
The following queries are now equivalent:
Post.where(:author_id => Author.first)
Post.where(:author => Author.first)
PriceEstimate.where(:estimate_of_type => 'Treasure', :estimate_of_id => treasure)
PriceEstimate.where(:estimate_of => treasure)
|
| |
|
|
|
|
|
|
|
|
|
| |
This implements the support to encode/decode JSON
data to/from database and creating columns of type
JSON using a native type [1] supported by PostgreSQL
from version 9.2.
[1] http://www.postgresql.org/docs/9.2/static/datatype-json.html
|
| |
|
|
|
|
|
| |
All tests with a custom inheritance_column use the `Vegtable` model.
The field ruby_type on the Company models is no longer needed
|
|
|
|
|
|
| |
previously the tests with and without a custom `inheritance_column`
used the same models. Since the model then has both fields this can lead
to false positives.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I had to create a new table because I needed an STI table,
which does not have both a "type" and a "custom_type"
the test fails with:
1) Error:
test_alt_becomes_works_with_sti(InheritanceTest):
NoMethodError: undefined method `type=' for #<Cabbage id: 1, name: "my cucumber", custom_type: "Cucumber">
/Users/username/Projects/rails/activemodel/lib/active_model/attribute_methods.rb:432:in `method_missing'
/Users/username/Projects/rails/activerecord/lib/active_record/attribute_methods.rb:100:in `method_missing'
/Users/username/Projects/rails/activerecord/lib/active_record/persistence.rb:165:in `becomes'
test/cases/inheritance_test.rb:134:in `test_becomes_works_with_sti'
test/cases/inheritance_test.rb:140:in `test_alt_becomes_works_with_sti'
|
|
|
|
|
|
| |
associations with the same foreign key.
This closes #5200.
|
|
|
|
|
|
|
| |
to address ORA-01400 errors with Oracle enhanced adapter.
The original commit 3c0bf043 requires :json_data_empty attribute
has empty string OR null, then setting `:default => ""` is enough.
|
|
|
|
|
|
|
|
| |
to address ORA-01400 errors with Oracle enhanced adapter.
Issue #4856 had been fixed and tested with
the attribute `:null => false, :default => ""`.
Now `:null => false` attribute is not necessary to test this issue.
|
|
|
|
| |
to make store works all database adapters.
|