aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
Commit message (Collapse)AuthorAgeFilesLines
* Doc pass for `Type::Value` [ci skip]Sean Griffin2014-06-242-23/+43
|
* Merge pull request #15895 from sgrif/sg-numeric-changesYves Senn2014-06-243-3/+35
|\ | | | | Always assume strings with non-numeric characters change numeric types
| * Always assume strings with non-numeric characters change numeric typesSean Griffin2014-06-243-3/+35
| | | | | | | | | | | | | | | | We previously only did this if the old value was zero, to make sure numericality validations run and failed if the user gave 'wibble' as the value, which would be type cast to 0. However, numericality validations will fail if there are any non-numeric characters in the string, so 5 -> '5wibble' should also be marked as changed.
* | Silence warning in testSean Griffin2014-06-242-7/+7
|/ | | | | We still had one file using `column_for_attribute` when it could return nil, causing deprecation warnings in the tests.
* add missing `:nodoc:` to `store.rb`. [ci skip]Yves Senn2014-06-241-4/+4
|
* add missing `:nodoc:` for recent refactorings. [ci skip]Yves Senn2014-06-2431-36/+35
| | | | | | | | | | Adding `# :nodoc:` to the parent `class` / `module` is not going to ignore nested classes or modules. There is a modifier `# :nodoc: all` but sadly the containing class or module will continue to be in the docs. /cc @sgrif
* Merge pull request #15881 from mmozuras/remove_unused_paramsRafael Mendonça França2014-06-232-5/+5
|\ | | | | Remove unused params
| * Remove unused param 'conn' from ConnectionPool#releaseMindaugas Mozūras2014-06-231-3/+3
| |
| * Remove unused param 'klass' from AttributeAssignment#read_otherMindaugas Mozūras2014-06-231-2/+2
| |
* | Merge pull request #15878 from sgrif/sg-null-columnRafael Mendonça França2014-06-235-33/+18
|\ \ | | | | | | Revert #15502, and add a deprecation warning instead.
| * | Add a deprecation cycle for `NullColumn` from `column_for_attribute`Sean Griffin2014-06-235-33/+18
| |/ | | | | | | | | | | This is public API, and `simple_form` depends on the `nil` return value. We need to go through a deprecation cycle to return a null object. If people want hash access, they can access the hash.
* / Small typoAnton Cherepanov2014-06-232-2/+2
|/
* Merge pull request #15867 from sgrif/sg-rm-column-typesYves Senn2014-06-233-5/+1
|\ | | | | Remove unneeded `@column_types` instance variable
| * Remove unneeded `@column_types` instance variableSean Griffin2014-06-223-5/+1
| | | | | | | | This was used more previously, but other uses have been removed.
* | changelog entries for #15866 and #15848Yves Senn2014-06-221-0/+11
| | | | | | | | /cc @sgrif
* | Merge pull request #15848 from sgrif/sg-remove-deprecationYves Senn2014-06-221-8/+1
|\ \ | |/ |/| Remove old deprecation warning
| * Remove old deprecation warningSean Griffin2014-06-221-8/+1
| | | | | | | | | | This has been around for a couple of versions now, a `NoMethodError` should suffice at this point.
* | Merge pull request #15865 from sgrif/sg-missing-testYves Senn2014-06-221-0/+20
|\ \ | | | | | | Add missing test cases for `attribute_names` instance method
| * | Add missing test cases for `attribute_names` instance methodSean Griffin2014-06-221-0/+20
| |/ | | | | | | | | There is a class method with the same name that is tested, but not the instance method.
* / `reload` should fully reload attributesSean Griffin2014-06-223-5/+8
|/ | | | | | `reload` is meant to put a record in the same state it would be if you were to do `Post.find(post.id)`. This means we should fully replace the attributes hash.
* Merge pull request #15839 from sgrif/sg-attr-set-nullYves Senn2014-06-226-12/+17
|\ | | | | Return a null object from `AttributeSet#[]`
| * Return a null object from `AttributeSet#[]`Sean Griffin2014-06-206-12/+17
| |
* | Merge pull request #15849 from sgrif/sg-move-attributesYves Senn2014-06-223-3/+14
|\ \ | | | | | | Move `attributes` to the `AttributeSet` object.
| * | Move `attributes` to the `AttributeSet` object.Sean Griffin2014-06-213-3/+14
| |/
* / Add missing test cases for `attribute_method?`Sean Griffin2014-06-211-0/+11
|/
* docs, configurations method is listed in the docs. [ci skip]Yves Senn2014-06-201-1/+0
| | | | | The :singleton-method: directive is printed in the docs. This directive is not necessary as the method is documentable just fine.
* Merge pull request #15728 from sgrif/sg-double-save-hm-tRafael Mendonça França2014-06-193-4/+30
|\ | | | | | | | | | | | | | | Don't save through records twice Conflicts: activerecord/CHANGELOG.md activerecord/test/cases/associations/has_many_through_associations_test.rb
| * Don't save through records twiceSean Griffin2014-06-173-3/+29
| | | | | | | | | | | | | | If the through record gets created in an `after_create` hook that is defined before the association is defined (therefore after its `after_create` hook) get saved twice. This ensures that the through records are created only once, regardless of the order of the hooks.
* | Merge pull request #15747 from sgrif/sg-trolololol-this-is-so-brokenRafael Mendonça França2014-06-193-1/+56
|\ \ | | | | | | Always update counter caches in memory when adding records
| * | Always update counter caches in memory when adding recordsSean Griffin2014-06-163-1/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, calling `size` would only work if it skipped the cache, and would return a different result from the cache, but only if: - The association was previously loaded - Or you called size previously - But only if the size was 0 when you called it This ensures that the counter is appropriately updated in memory.
* | | Merge pull request #15800 from sgrif/sg-column-in-calculationRafael Mendonça França2014-06-192-17/+8
|\ \ \ | | | | | | | | Don't use `Column` for type casting in Relation calculations
| * | | Don't use `Column` for type casting in Relation calculationsSean Griffin2014-06-182-17/+8
| | | |
* | | | Merge pull request #15801 from sgrif/sg-column-defaultsRafael Mendonça França2014-06-191-2/+2
|\ \ \ \ | | | | | | | | | | Don't use column object when calculating type cast defaults
| * | | | Don't use column object when calculating type cast defaultsSean Griffin2014-06-181-2/+2
| |/ / / | | | | | | | | | | | | Moves towards removing type casting knowledge from the column entirely
* | | | Merge pull request #15802 from sgrif/sg-column-quotingRafael Mendonça França2014-06-193-31/+6
|\ \ \ \ | | | | | | | | | | Don't use column object for type casting in `quoting`
| * | | | Don't use column object for type casting in `quoting`Sean Griffin2014-06-183-31/+6
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're never going to be able to use the attribute object here, however, so let's just accept the ugly demeter violation here for now. Remove test cases which were either redundant with other tests in the file, or were actually testing the type objects (which are tested elsewhere)
* | | | Merge pull request #15803 from sgrif/sg-column-in-associationsRafael Mendonça França2014-06-193-5/+5
|\ \ \ \ | | | | | | | | | | Don't rely on the column for type casting reflections
| * | | | Don't rely on the column for type casting reflectionsSean Griffin2014-06-183-5/+5
| |/ / /
* | | | Merge pull request #15814 from sgrif/sg-number-changedRafael Mendonça França2014-06-191-12/+6
|\ \ \ \ | | | | | | | | | | Further simplify `changed?` conditional for numeric types
| * | | | Further simplify `changed?` conditional for numeric typesSean Griffin2014-06-191-12/+6
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | `Type::Integer.new.type_cast('') # => nil`, we do not need a special case to handle this, `nil => ''` already returns false. The only case we need to handle is `0 => 'wibble'` should be changed, while `0 => '0'` should not.
* | | | Merge pull request #15818 from sgrif/sg-attribute-setRafael Mendonça França2014-06-198-23/+120
|\ \ \ \ | | | | | | | | | | Introduce an object to aid in creation and management of `@attributes`
| * | | | Introduce an object to aid in creation and management of `@attributes`Sean Griffin2014-06-198-23/+120
| |/ / / | | | | | | | | | | | | | | | | Mostly delegation to start, but we can start moving a lot of behavior in bulk to this object.
* | | | Merge pull request #15772 from nbudin/sti_through_bugRafael Mendonça França2014-06-193-1/+18
|\ \ \ \ | | | | | | | | | | | | | | | Don't include inheritance column in the through_scope_attributes
| * | | | Don't include inheritance column in the through_scope_attributesNat Budin2014-06-173-2/+17
| | |_|/ | |/| |
* | | | Use a better test descriptionRafael Mendonça França2014-06-191-1/+1
| | | |
* | | | Fix has_and_belongs_to_many in a namespaced model pointing to a non ↵Rafael Mendonça França2014-06-194-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | namespaced model Now the following case will work fine class Tag < ActiveRecord::Base end class Publisher::Article < ActiveRecord::Base has_and_belongs_to_many :tags end Fixes #15761
* | | | this method is no longer being usedJosh Sharpe2014-06-191-4/+0
| |/ / |/| |
* | | Reconnect after possibly enabling hstoreMatthew Draper2014-06-181-0/+2
| | |
* | | Merge pull request #15782 from sgrif/sg-column-defaultsMatthew Draper2014-06-1817-68/+60
|\ \ \ | | | | | | | | Don't type cast the default on the column
| * | | Don't type cast the default on the columnSean Griffin2014-06-1717-68/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If we want to have type decorators mess with the attribute, but not the column, we need to stop type casting on the column. Where possible, we changed the tests to test the value of `column_defaults`, which is public API. `Column#default` is not.