aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | Merge pull request #15172 from notEthan/active_record_pretty_printRafael Mendonça França2014-06-033-0/+95
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implement ActiveRecord::Base#pretty_print Conflicts: activerecord/CHANGELOG.md
| * | | | | | implement ActiveRecord::Base#pretty_print + changelogEthan2014-05-293-0/+95
| | | | | | |
* | | | | | | Merge pull request #15492 from sgrif/sg-dirty-defaultsRafael Mendonça França2014-06-035-2/+40
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Keep column defaults in type cast form
| * | | | | | | Keep column defaults in type cast formSean Griffin2014-06-035-2/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The contract of `_field_changed?` assumes that the old value is always type cast. That is not the case for the value in `Column#default` as things are today. It appears there are other public methods that assume that `Column#default` is type cast, as well. The reason for this change originally was because the value gets put into `@raw_attributes` in initialize. This reverts to the old behavior on `Column`, and updates `initialize` to make sure that the values are in the right format.
* | | | | | | | 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
* | | | | | | | Merge pull request #15486 from sgrif/sg-binary-quotingMatthew Draper2014-06-045-47/+83
|\ \ \ \ \ \ \ \ | |_|_|_|/ / / / |/| | | | | | | Refactor quoting of binary data to not be based on the column type
| * | | | | | | Refactor quoting of binary data to not be based on the column typeSean Griffin2014-06-035-47/+83
| |/ / / / / /
* | | | | | | 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-037-22/+39
| | | | | | |
* | | | | | | test pg, rm unused requires.Yves Senn2014-06-0311-27/+0
| |_|/ / / / |/| | | | |
* | | | | | Merge pull request #15487 from sgrif/sg-bit-limitYves Senn2014-06-033-32/+32
|\ \ \ \ \ \ | | | | | | | | | | | | | | Respect limit for PG bit strings
| * | | | | | Respect limit for PG bit stringsSean Griffin2014-06-033-32/+32
| | | | | | |
* | | | | | | Merge pull request #15442 from sgrif/sg-refactor-field-changedYves Senn2014-06-036-36/+39
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | Refactor determination of whether the field has changed
| * | | | | | Refactor determination of whether the field has changedSean Griffin2014-06-036-36/+39
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | The types know more about what is going on than the dirty module. Let's ask them!
* | | | | | pg, preserve type when schema dumping bit and bit varying columns.Yves Senn2014-06-037-12/+44
| | | | | |
* | | | | | test pg, move bit string type tests into `bit_string_test.rb`.Yves Senn2014-06-033-42/+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-036-11/+24
| | | | |
* | | | | pg test, examples for default values and schema dumping of point types.Yves Senn2014-06-032-0/+32
| | | | | | | | | | | | | | | | | | | | /cc @sgrif
* | | | | fix polymorphic? method and reuse iteileencodes2014-06-024-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix polymorphic to check for `options[:polymorphic]` instead of `options.key? :polymorphic` and then reuse the method `polymorphic?` method instead of constantly checking the same `options[:polymorphic]`.
* | | | | Merge pull request #15475 from sgrif/sg-initialize-attributesGuillermo Iguaran2014-06-023-11/+3
|\ \ \ \ \ | | | | | | | | | | | | Remove unused `initialize_attributes` method
| * | | | | Remove unused `initialize_attributes` methodSean Griffin2014-06-023-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was previously a hook for a special case related to `serialize`, which has since been removed.
* | | | | | Add missing colon to internalSean Griffin2014-06-021-1/+1
|/ / / / /
* | | | | just use `assert`Aaron Patterson2014-06-021-1/+1
| | | | |
* | | | | docs, fix typo [ci skip]Yves Senn2014-06-021-2/+2
| | | | |
* | | | | test pg, add basic test cases for point datatype.Yves Senn2014-06-021-0/+45
| | | | |
* | | | | pg, inline casting methods into `OID::Type` objects.Yves Senn2014-06-024-44/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This inlines casting for the most obvious types. The rest will follow eventually. I need to put some tests in place, to make sure that the inlining is not causing regressions. /cc @sgrif
* | | | | Feature requests should be made on the mailing list, not submitted toZachary Scott2014-06-011-1/+6
| | | | | | | | | | | | | | | | | | | | the issue tracker. See also #15455 [ci skip]
* | | | | New records should remain new after yaml serializationSean Griffin2014-06-014-2/+28
| | | | |
* | | | | Remove most code related to serialized propertiesSean Griffin2014-06-0112-103/+30
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge pull request #15432 from sgrif/sg-coder-type-castingYves Senn2014-06-014-23/+14
|\ \ \ \ | |_|_|/ |/| | | Don't change values in `@raw_attributes` during serialization
| * | | Don't change values in `@raw_attributes` during serializationSean Griffin2014-06-014-23/+14
| | | | | | | | | | | | | | | | | | | | | | | | During `init_with`, the attributes given to the coder will be placed into `@raw_attributes`. As such, we should read from `@raw_attributes` when encoding, rather than `@attributes`, which has been type cast.
* | | | Merge branch 'master' of github.com:rails/docrailsVijay Dev2014-06-012-5/+5
|\ \ \ \ | |/ / / |/| | |
| * | | [ci skip] add created_at and updated_at to exampleschneems2014-05-291-2/+2
| | | |
| * | | :scissors:Zachary Scott2014-05-121-3/+3
| | | |
* | | | Merge pull request #15434 from sgrif/sg-clear-cachesYves Senn2014-05-312-3/+27
|\ \ \ \ | | | | | | | | | | Clear all caches calculated based on `@columns` when `@columns` changes
| * | | | Clear all caches calculated based on `@columns` when `@columns` changesSean Griffin2014-05-312-3/+27
| | | | |
* | | | | Add missing test case for writing unknown attributesSean Griffin2014-05-301-0/+2
|/ / / /
* | | | Update some bad test cases for serialized columnsSean Griffin2014-05-301-53/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first case was not testing what the issue mentioned actually was (A subclass of a class with serialized attributes does not serialize when they come from the database). The second case was a bad coder. It would fail if the model was `dup`ed, or if the the model was loaded from the database and then saved again. The third case wasn't testing anything that wasn't covered by the second (and was also a bad coder for the same reasons as the second).
* | | | Merge pull request #15427 from sgrif/sg-rename-attribute-ivarsRafael Mendonça França2014-05-3013-44/+44
|\ \ \ \ | | | | | | | | | | Rename attribute related instance variables to better express intent
| * | | | Rename attribute related instance variables to better express intentSean Griffin2014-05-3013-44/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `@attributes` was actually used for `_before_type_cast` and friends, while `@attributes_cache` is the type cast version (and caching is the wrong word there, but I'm working on removing the conditionals around that). I opted for `@raw_attributes`, because `_before_type_cast` is also semantically misleading. The values in said hash are in the state given by the form builder or database, so raw seemed to be a good word.
* | | | | Allow specifying a default value in overloaded propertiesSean Griffin2014-05-303-6/+19
|/ / / /
* | | | refactor, introduce `Type#type_cast_for_schema` to cast for schema.rbYves Senn2014-05-308-26/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the case statement in `SchemaDumper` and gives every `Type` the possibility to control the SchemaDumper default value output. /cc @sgrif
* | | | pg, support default values for enum types. Closes #7814.Yves Senn2014-05-304-2/+24
| | | | | | | | | | | | | | | | | | | | 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-303-10/+12
| | | |
* | | | Merge pull request #11896 from nkondratyev/fix_pg_columns_for_distinctYves Senn2014-05-303-1/+17
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed #columns_for_distinct of postgresql adapter Conflicts: activerecord/CHANGELOG.md
| * | | | Fixed `columns_for_distinct` of postgresql adapterNikolay Kondratyev2013-08-153-1/+17
| | | | |
* | | | | pg, `reset_pk_sequence!` respects schemas. Closes #14719.Yves Senn2014-05-305-11/+34
| | | | |
* | | | | pg, `PostgreSQL::Name` to hold schema qualified names.Yves Senn2014-05-304-19/+96
| | | | |