aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/postgresql
Commit message (Collapse)AuthorAgeFilesLines
* Silence warnings in tests.Sean Griffin2014-06-101-1/+1
| | | | | | | | ``` activerecord/test/cases/adapters/postgresql/range_test.rb:159: warning: (...) interpreted as grouped expression activerecord/test/cases/finder_test.rb:38: warning: shadowing outer local variable - e activerecord/test/cases/finder_test.rb:43: warning: shadowing outer local variable - e ```
* Rename `type_cast` to `type_cast_from_database`Sean Griffin2014-06-096-26/+26
| | | | | | | | In some cases there is a difference between the two, we should always be doing one or the other. For convenience, `type_cast` is still a private method on type, so new types that do not need different behavior don't need to implement two methods, but it has been moved to private so it cannot be used accidentally.
* Merge pull request #15587 from sgrif/sg-remove-workaroundRafael Mendonça França2014-06-091-15/+8
|\ | | | | Remove workaround for non-lazy serialize in tests
| * Remove workaround for non-lazy serialize in testsSean Griffin2014-06-091-15/+8
| | | | | | | | `serialize` is now lazy, so the workaround is no longer needed.
* | Make `_before_type_cast` actually be before type castSean Griffin2014-06-093-1/+7
|/ | | | | | | | | | | | | - The following is now true for all types, all the time - `model.attribute_before_type_cast == given_value` - `model.attribute == model.save_and_reload.attribute` - `model.attribute == model.dup.attribute` - `model.attribute == YAML.load(YAML.dump(model)).attribute` - Removes the remaining types implementing `type_cast_for_write` - Simplifies the implementation of time zone aware attributes - Brings tz aware attributes closer to being implemented as an attribute decorator - Adds additional point of control for custom types
* Ensure time zones don't change after round trip with array columnsSean Griffin2014-06-071-0/+2
| | | | | The times would be equivalent, even if they were in different time zones. E.g. 12:00 UTC == 5:00 PDT
* Don't rely on `Time.current` in testsSean Griffin2014-06-071-5/+10
| | | | Millisecond inequality causes failures on Travis
* Add array support when time zone aware attributes are enabledSean Griffin2014-06-071-0/+16
|
* serialized Type should delegate `type_cast_for_write` to underlying TypeYves Senn2014-06-061-0/+35
| | | | | | | This adds a regression test for #14411, which was fixed by #15503. Closes #14411 Closes #14595
* Merge pull request #15503 from sgrif/sg-json-hstore-storageYves Senn2014-06-062-0/+18
|\ | | | | Bring type casting behavior of hstore/json in line with serialized
| * Bring type casting behavior of hstore/json in line with serializedSean Griffin2014-06-042-0/+18
| | | | | | | | | | `@raw_attributes` should not contain the type-cast, mutable version of the value.
* | Fix behavior of handling BC era dates.edogawaconan2014-06-051-0/+12
|/ | | | BC era year is (astronomical year + 1) and starts from 1 BC.
* force table creationAaron Patterson2014-06-031-2/+3
|
* Revert "test pg, we don't care about the internal state of `column#default`."Yves Senn2014-06-037-0/+23
| | | | | | | | | | | | | | Revert "test pg, remove unused column assignments. Follow up to 254cdf47" Related to #15492 This reverts commit 254cdf4728291277f3fbaa854f34495030e476b4. This reverts commit 4bcf9029452e0c760af04faab6b549710401e8cf. There are public methods that assume `Column#default` is type casted. The return value of `Column#default` is publicly relevant and should not change. /cc @sgrif
* test pg, remove unused column assignments. Follow up to 254cdf47Yves Senn2014-06-035-12/+0
|
* pg, preserve money type when dumping schema and extract money default.Yves Senn2014-06-032-9/+25
|
* test pg, rm unused requires.Yves Senn2014-06-0311-27/+0
|
* Respect limit for PG bit stringsSean Griffin2014-06-031-8/+8
|
* pg, preserve type when schema dumping bit and bit varying columns.Yves Senn2014-06-031-8/+8
|
* test pg, move bit string type tests into `bit_string_test.rb`.Yves Senn2014-06-032-34/+80
|
* test pg, we don't care about the internal state of `column#default`.Yves Senn2014-06-035-9/+0
| | | | | That data is internal to Active Record. What we care about is that new records have the right default value.
* pg, preserve point type when schema dumping.Yves Senn2014-06-031-8/+8
|
* pg test, examples for default values and schema dumping of point types.Yves Senn2014-06-031-0/+21
| | | | /cc @sgrif
* test pg, add basic test cases for point datatype.Yves Senn2014-06-021-0/+45
|
* Remove most code related to serialized propertiesSean Griffin2014-06-011-0/+1
| | | | | | | | | | | Nearly completely implemented in terms of custom properties. `_before_type_cast` now stores the raw serialized string consistently, which removes the need to keep track of "state". The following is now consistently true: - `model.serialized == model.reload.serialized` - A model can be dumped and loaded infinitely without changing - A model can be saved and reloaded infinitely without changing
* pg, support default values for enum types. Closes #7814.Yves Senn2014-05-301-0/+11
| | | | | This is an intermediate solution. It is related to the refactoring @sgrif is making and will change in the future.
* pg, `default_sequence_name` respects schema. Closes #7516.Yves Senn2014-05-301-8/+6
|
* Merge pull request #11896 from nkondratyev/fix_pg_columns_for_distinctYves Senn2014-05-301-0/+11
|\ | | | | | | | | | | | | Fixed #columns_for_distinct of postgresql adapter Conflicts: activerecord/CHANGELOG.md
| * Fixed `columns_for_distinct` of postgresql adapterNikolay Kondratyev2013-08-151-0/+11
| |
* | pg, `reset_pk_sequence!` respects schemas. Closes #14719.Yves Senn2014-05-302-5/+16
| |
* | pg, `PostgreSQL::Name` to hold schema qualified names.Yves Senn2014-05-301-2/+43
| |
* | Merge pull request #15370 from sgrif/sg-type-namespaceRafael Mendonça França2014-05-281-1/+1
|\ \ | | | | | | Move types to the top level `ActiveRecord` namespace
| * | Move types to the top level `ActiveRecord` namespaceSean Griffin2014-05-271-1/+1
| | | | | | | | | | | | | | | `ActiveRecord::ConnectionAdapters::Type::Value` => `ActiveRecord::Type::Value`
* | | pg, keep `hstore` and `json` attributes as `Hash` in @attributes.Yves Senn2014-05-282-0/+18
|/ / | | | | | | | | | | | | | | | | | | | | The solution presented in this patch is not efficient. We should replace it in the near future. The following needs to be worked out: * Is `@attributes` storing the Ruby or SQL representation? * `cacheable_column?` is broken but `hstore` and `json` rely on that behavior Refs #15369. /cc @sgrif @rafaelfranca
* | Merge pull request #15307 from sgrif/sg-type-cast-for-writeYves Senn2014-05-261-1/+0
|\ \ | | | | | | Add an interface for type objects to control Ruby => SQL
| * | Add an interface for type objects to control Ruby => SQLSean Griffin2014-05-261-1/+0
| | | | | | | | | | | | | | | Adds the ability to save custom types, which type cast to non-primitive ruby objects.
* | | remove unused variable warningKuldeep Aggarwal2014-05-261-1/+1
|/ / | | | | | | `warning: assigned but unused variable - album`
* | Merge pull request #15249 from sgrif/sg-register-types-in-adapterRafael Mendonça França2014-05-221-9/+1
|\ \ | | | | | | Use the generic type map for all PG type registrations
| * | Use the generic type map for all PG type registrationsSean Griffin2014-05-221-9/+1
| | | | | | | | | | | | | | | | | | | | | We're going to want all of the benefits of the type map object for registrations, including block registration and real aliasing. Moves type name registrations to the adapter, and aliases the OIDs to the named types
* | | pg test, extract tsvector tests into `postgresql/full_text_test.rb`Yves Senn2014-05-222-27/+31
| | |
* | | pg test, move timestamp tests over to `postgresql/timestamp_test.rb`.Yves Senn2014-05-222-43/+53
| | |
* | | pg test, extract network address type tests into separate file.Yves Senn2014-05-223-51/+79
| | |
* | | pg test, remove unused code.Yves Senn2014-05-221-3/+0
|/ /
* | Rename `oid_type` to `cast_type` to make PG columns consistentSean Griffin2014-05-211-10/+1
| |
* | pg, extract money tests into separate file.Yves Senn2014-05-212-35/+55
| | | | | | | | | | - Added assertions about the column. Specifically scale. - Move record insertion from setup into test method.
* | Delegate predicate methods to injected type object on ColumnSean Griffin2014-05-201-1/+1
| |
* | Have Postgres OID types inherit from general typesSean Griffin2014-05-201-4/+4
| | | | | | | | | | Using general types where possible. Several more can go away once infinity gets figured out.
* | Fixed the inferred table name for HABTM within a schemaEric Chahin2014-05-201-0/+26
| | | | | | | | Fixes #14824.
* | Fixing test order issuesRafael Mendonça França2014-05-191-2/+8
| |
* | Merge pull request #10798 from ↵Rafael Mendonça França2014-05-191-0/+59
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | jcxplorer/fix-enable_extension-with-table_name_prefix Fix migrations that use enable_extension with table_name_prefix/suffix Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/migration.rb