| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changes:
* According to postgreSQL documentation:
(http://www.postgresql.org/docs/8.2/static/catalog-pg-attrdef.html)
we should not be using 'adsrc' field because this field is unaware of
outside changes that could affect the way that default values are
represented. Thus, I changed the queries to use
"pg_get_expr(adbin, adrelid)" instead of the historical "adsrc" field.
* Remove parsing of character type default values for 8.1 formatting since
Rails doesn't support postgreSQL 8.1 anymore.
* Remove misleading comment unrelated to code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
If you create a new record via a collection association proxy that has
not loaded its target, and which selects additional attributes through
the association, then when the proxy loads its target, it will
inadvertently trigger a deprecation notice during attribute writing when
CollectionAssociation#merge_target_lists attempts to do its thing, since
the newly loaded records will possess attributes the created record does
not.
|
|
|
|
|
|
| |
Without eager autoloading, these would be autoloaded
only when #preloader_for is called, which is too late
in threaded applications.
|
| |
|
|
|
|
|
|
|
|
|
| |
senny/5920_postgres_adapter_table_with_capital_letters
postgres, quote table names when fetching the primary key (#5920)
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
|
|
|
|
| |
Count returns 0 without querying if parent is not saved
|
|
|
|
|
| |
Conflicts:
activerecord/lib/active_record/counter_cache.rb
|
|
|
|
|
|
|
| |
Fix reset_counters crashing on has_many :through associations.
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/counter_cache.rb
|
| |
|
|
|
|
|
|
|
| |
Backport of #6441 cb6f83935 . Old 'wait_timeout' is still supported,
but conflicts with mysql2 using that spec key for different thing.
'checkout_timeout' can now be used taking precedence for ConnectionPool
over 'wait_timeout'.
|
|
|
|
|
|
|
|
| |
Rename field_changed? to _field_changed? so that users can create a field named field
Conflicts:
activerecord/lib/active_record/core.rb
activerecord/test/cases/dirty_test.rb
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 0693e079708a52b777f2b7872b8e3d467b880a0d.
Revert "Cache columns metadata to avoid extra while testing"
This reverts commit a82f1e3f5d11c8dfba9f4c911745ec40a7965216.
Reason: This is causing failures in the postgresql build.
See http://travis-ci.org/#!/rails/rails/builds/2485584
Related with #7675
|
|
|
|
|
| |
Conflicts:
activerecord/lib/active_record/railties/databases.rake
|
| |
|
|
|
|
| |
Fix collection= on hm:t join models when unsaved
|
|
|
|
|
|
|
|
|
| |
Don't preserve SELECT columns on COUNT
Closes #7651
Conflicts:
activerecord/test/cases/associations/has_many_associations_test.rb
|
|
|
|
|
|
|
|
| |
* Mark as SCHEMA some schema database queries. #7648
* Don't explain queries except normal CRUD sql. #7657
Closes #6458
Closes #7544
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
6d5f4de4c420ebb906109668f5702a537ac77692
Simulated & actual (manual/skipped) PostgreSQL auto-reconnection tests.
4b1bca04025a66c54e6e9d5eb6e4d4056bfa92f0
Stop being silly with formatting of method aliasing.
c381d5cbf959208adeb38e7859ee815dfbd2cf54
Fix just-plain-wrongness of psql auto-reconnect test.
1e17a9d367c54c680368be72f44247ae28b98904
Fix only-once stub logic.
f16c2043826ec1991cf94fe17cb671507b7a7f51
Changelog for PostgreSQL auto-reconnect test coverage backport.
|
|
|
|
| |
configuration use not charset but encoding.
|
|\
| |
| | |
type_cast_code should always convert values to integer calling #to_i
|
| |
| |
| |
| | |
integer calling #to_i
|
| |
| |
| |
| |
| |
| | |
Fix for time type columns with invalid time value
Conflicts:
activerecord/CHANGELOG.md
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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'
Conflicts:
activerecord/test/cases/inheritance_test.rb
|
| |
|
|
|
|
|
|
|
|
| |
conditions
Conflicts:
activerecord/test/models/reader.rb
|
|
|
|
|
|
|
|
| |
Fix for #5200
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/counter_cache.rb
|
|
|
|
|
|
|
| |
Fix #6975. Round usec when writing timestamp attribute.
Conflicts:
activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
|
|
|
|
|
|
|
|
|
|
|
| |
brainopia/use_inversed_parent_for_first_and_last_child
Use inversed parent for first and last child of has_many association
[Backport] Closes #3223.
Conflicts:
activerecord/lib/active_record/associations/collection_association.rb
|
|\
| |
| |
| |
| | |
ManageIQ/fix_table_remove_passing_array_deprecation
Table#remove passed an array to remove_column, which is deprecated.
|
| |
| |
| |
| | |
See 02ca9151a043a4fefbb3f22edd05f0cd392fffaa
|
|/
|
|
| |
Use round to get the right conversion
|
|
|
|
|
|
| |
Fix occasional microsecond conversion inaccuracy
Conflicts:
activerecord/CHANGELOG.md
|
|
|
|
|
|
|
|
|
|
|
|
| |
Revert "Deprecate update_attribute."
This reverts commit b081f6b59fb3f15d12043072ad9b331ffd2bc56e.
Reason: Since the new deprecation policy we removed the deprecation of
update_attribute but we didn't reverted the changes to use
update_column.
Fixes #7306
|
|
|
|
|
|
| |
Restore state on create when ActiveRecord::RecordInvalid is raised
Conflicts:
activerecord/CHANGELOG.md
|
|
|
|
|
|
| |
Fix #7191. Remove unnecessary transaction when assigning has_one associations.
Conflicts:
activerecord/test/cases/associations/has_one_associations_test.rb
|
|\ |
|
| | |
|
| | |
|
| |
| |
| |
| | |
`Rails.env` already use development if ENV["RAILS_ENV"] is not present.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
zero and the new value is not a string.
Before this commit this was the behavior
r = Review.find_by_issue(0)
r.issue
=> 0
r.changes
=> {}
r.issue = 0
=> 0
r.changed?
=> true
r.changes
=> {"issue"=>[0,0]}
Fixes #7237
|
| | |
|
| |
| |
| |
| |
| |
| | |
Remove prepared statement from system query in postgresql adapter
Conflicts:
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
|
| |
| |
| |
| |
| |
| |
| | |
Missed extend for eager_autoload
This backport is trying to fix a bug with eager load
ActiveRecord::Associations modules
|
| |
| |
| |
| |
| |
| |
| |
| | |
Make sure :environment task is executed before db:schema:load or
db:structure:load
Conflicts:
activerecord/CHANGELOG.md
|
| |
| |
| |
| | |
`Rails.env` already use development if ENV["RAILS_ENV"] is not present.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
zero and the new value is not a string.
Before this commit this was the behavior
r = Review.find_by_issue(0)
r.issue
=> 0
r.changes
=> {}
r.issue = 0
=> 0
r.changed?
=> true
r.changes
=> {"issue"=>[0,0]}
Fixes #7237
|
|/
|
|
| |
postgresql_adapter.rb while creating distincts.
|
| |
|
|
|
|
| |
Applying the new policy here to not deprecate stuff in point releases.
|