aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/bird.rb
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Merge pull request #35186 from ↵Ryuta Kamizono2019-02-151-2/+2
| | | | | | | | | | | | kamipo/fix_leaking_scope_on_relation_create" This reverts commit b67d5c6dedbf033515a96a95d24d085bf99a0d07, reversing changes made to 2e018361c7c51e36d1d98bf770b7456d78dee68b. Reason: #35186 may cause that silently leaking information when people upgrade the app. We need deprecation first before making this.
* Fix `relation.create` to avoid leaking scope to initialization block and ↵Ryuta Kamizono2019-02-071-0/+5
| | | | | | | | | | | | | | | | | | | | callbacks `relation.create` populates scope attributes to new record by `scoping`, it is necessary to assign the scope attributes to the record and to find STI subclass from the scope attributes. But the effect of `scoping` is class global, it was caused undesired behavior that pollute all class level querying methods in initialization block and callbacks (`after_initialize`, `before_validation`, `before_save`, etc), which are user provided code. To avoid the leaking scope issue, restore the original current scope before initialization block and callbacks are invoked. Fixes #9894. Fixes #17577. Closes #31526.
* Don't treat begin and rollback transactions as write queriesRyuta Kamizono2018-12-111-0/+5
| | | | | Otherwise `save` method would raise the `ReadOnlyError` against `BEGIN` and `ROLLBACK` queries.
* Use frozen-string-literal in ActiveRecordKir Shatrov2017-07-191-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* modernizes hash syntax in activerecordXavier Noria2016-08-061-1/+1
|
* Deprecate `false` as the way to halt AR callbacksclaudiob2015-01-021-1/+1
| | | | | | | | | | Before this commit, returning `false` in an ActiveRecord `before_` callback such as `before_create` would halt the callback chain. After this commit, the behavior is deprecated: will still work until the next release of Rails but will also display a deprecation warning. The preferred way to halt a callback chain is to explicitly `throw(:abort)`.
* Allow nested attributes in associations to update values in it's owner ↵Andrew Kaspick2011-12-141-1/+4
| | | | object. Fixes a regression from 3.0.x
* Rollback the transaction when one of the autosave associations fails to ↵Eloy Duran2010-01-081-0/+6
| | | | save. [#3391 state:resolved]
* Add support for nested object forms to ActiveRecord and the helpers in ↵Eloy Duran2009-02-011-0/+3
ActionPack Signed-Off-By: Michael Koziarski <michael@koziarski.com> [#1202 state:committed]