aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #15503 from sgrif/sg-json-hstore-storageYves Senn2014-06-064-16/+7
|\ | | | | Bring type casting behavior of hstore/json in line with serialized
| * Bring type casting behavior of hstore/json in line with serializedSean Griffin2014-06-044-16/+7
| | | | | | | | | | `@raw_attributes` should not contain the type-cast, mutable version of the value.
* | `bin/rake db:migrate:status` works with legacy migration numbers.Yves Senn2014-06-063-4/+9
| | | | | | | | | | | | | | The migration numbers were normalized different ways. This left the task output in an inconsistent state. Closes #15538.
* | Merge pull request #14971 from versioncontrol/#14785Yves Senn2014-06-061-1/+8
|\ \ | | | | | | | | | Baseclass becomes! subclass
| * | Fix Baseclass becomes! subclass.Edo Balvers2014-05-131-1/+8
| | |
* | | Remove optimization that was required with whiny nilsSean Griffin2014-06-051-8/+0
| | | | | | | | | | | | Whiny nils is no longer a thing, so we no longer need this optimization
* | | Fix behavior of handling BC era dates.edogawaconan2014-06-052-3/+5
| | | | | | | | | | | | BC era year is (astronomical year + 1) and starts from 1 BC.
* | | Remove deprecated method ActiveRecord::Migrator.proper_table_nameAkshay Vishnoi2014-06-051-13/+0
| | |
* | | have an actual `NullColumn` object and update docs accordingly.Yves Senn2014-06-043-5/+15
| | | | | | | | | | | | | | | | | | Follow up to #15438 and #15502. /cc @sgrif
* | | Merge pull request #15502 from sgrif/sg-use-null-columnYves Senn2014-06-042-23/+23
|\ \ \ | | | | | | | | | | | | Use null column for association key types
| * | | Use null column for association key typesSean Griffin2014-06-042-23/+23
| | |/ | |/|
* | | Merge pull request #15504 from sgrif/sg-postgres-defaultsRafael Mendonça França2014-06-041-48/+6
|\ \ \ | | | | | | | | Collapse PG default extractoin of most types to single regex
| * | | Collapse PG default extractoin of most types to single regexSean Griffin2014-06-041-48/+6
| |/ / | | | | | | | | | | | | | | | | | | For any type that is represented as a string and then type cast, we do not need separate regular expressions for the various types. No function will match this regex. User defined types *should* match this, so that the type object can decide what to do with the value.
* | | Merge pull request #15463 from geopet/refactor_xml_compute_typeRafael Mendonça França2014-06-041-4/+4
|\ \ \ | |/ / |/| | Refactor XML serializer to not depend on `serialized_attributes`
| * | Refactor XML serializer to not depend on `serialized_attributes`Geoff Petrie & Sean Griffin2014-06-011-3/+5
| | |
| * | Test the serialized types of virtual columns in XMLGeoff Petrie & Sean Griffin2014-06-011-2/+0
| | | | | | | | | | | | | | | | | | | | | The previous tests were passing, because nothing ever looked at the generated XML. What was previously being generated was `<firstname type="NilClass">...`, which is not consistent with all other cases where there is not a known type.
* | | Merge pull request #15500 from ↵Yves Senn2014-06-041-2/+2
|\ \ \ | | | | | | | | | | | | | | | | prathamesh-sonpatki/change-wording-of-explanation-about-precision-and-scale-of-decimal-numbers Change wording of explanation about precision & scale of decimal numbers [ci skip]
| * | | Change wording of explanation about precision & scale of decimal numbers [ci ↵Prathamesh Sonpatki2014-06-041-2/+2
| | | | | | | | | | | | | | | | skip]
* | | | Merge pull request #15482 from laurocaetano/fix-regression-for-eager-loadCarlos Antonio da Silva2014-06-041-2/+4
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | Fix regression on eager loading association based on SQL query rather than existing column. Conflicts: activerecord/CHANGELOG.md
| * | | Fix regression on eager loading association based on SQL query ratherLauro Caetano2014-06-031-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | than existing column. Fixes #15480.
* | | | reuse available belongs_to? methodeileencodes2014-06-033-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reflection has a `belongs_to?` method. Instead of checking for `macro == :belongs_to` throughout the source reuse existing method. I also bumped `foreign_key_present?` method onto on line because the `belongs_to?` makes it shorter than other longer lines in the same class.
* | | | Merge pull request #15438 from sgrif/sg-null-columnRafael Mendonça França2014-06-033-14/+17
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Return a null column when no column exists for an attribute Conflicts: activerecord/CHANGELOG.md
| * | | | Return a null column when no column exists for an attributeSean Griffin2014-06-033-14/+17
| | | | |
* | | | | Merge pull request #15172 from notEthan/active_record_pretty_printRafael Mendonça França2014-06-031-0/+23
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implement ActiveRecord::Base#pretty_print Conflicts: activerecord/CHANGELOG.md
| * | | | | implement ActiveRecord::Base#pretty_print + changelogEthan2014-05-291-0/+23
| | | | | |
* | | | | | Merge pull request #15492 from sgrif/sg-dirty-defaultsRafael Mendonça França2014-06-034-2/+12
|\ \ \ \ \ \ | | | | | | | | | | | | | | Keep column defaults in type cast form
| * | | | | | Keep column defaults in type cast formSean Griffin2014-06-034-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | 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
| |/ / / / /
* | | / / / pg, preserve money type when dumping schema and extract money default.Yves Senn2014-06-033-0/+11
| |_|/ / / |/| | | |
* | | | | Merge pull request #15487 from sgrif/sg-bit-limitYves Senn2014-06-032-24/+24
|\ \ \ \ \ | | | | | | | | | | | | Respect limit for PG bit strings
| * | | | | Respect limit for PG bit stringsSean Griffin2014-06-032-24/+24
| | | | | |
* | | | | | 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-035-3/+31
|/ / / /
* | | | pg, preserve point type when schema dumping.Yves Senn2014-06-033-2/+11
| | | |
* | | | 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
|/ / / /
* | | | docs, fix typo [ci skip]Yves Senn2014-06-021-2/+2
| | | |
* | | | 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
* | | | New records should remain new after yaml serializationSean Griffin2014-06-012-2/+7
| | | |
* | | | Remove most code related to serialized propertiesSean Griffin2014-06-019-98/+21
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-012-2/+2
|\ \ \ | | | | | | | | Don't change values in `@raw_attributes` during serialization
| * | | Don't change values in `@raw_attributes` during serializationSean Griffin2014-06-012-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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-011-2/+2
|\ \ \ \ | |/ / / |/| | |
| * | | [ci skip] add created_at and updated_at to exampleschneems2014-05-291-2/+2
| | | |
* | | | Clear all caches calculated based on `@columns` when `@columns` changesSean Griffin2014-05-311-3/+7
| | | |
* | | | Merge pull request #15427 from sgrif/sg-rename-attribute-ivarsRafael Mendonça França2014-05-3012-43/+43
|\ \ \ \ | | | | | | | | | | Rename attribute related instance variables to better express intent