aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/callbacks_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Use assert_empty and assert_not_emptyDaniel Colson2018-01-251-7/+7
|
* Use assert_predicate and assert_not_predicateDaniel Colson2018-01-251-7/+7
|
* 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
|
* Fix a RuboCop offences using `rubocop -a`Koichi ITO2017-05-241-1/+1
|
* Restore `fixtures :author_addresses`Ryuta Kamizono2017-04-271-1/+1
| | | | | This change reverted in eac6f369 but it is needed for data integrity. See #25328.
* Revert "Merge pull request #27636 from ↵Rafael Mendonça França2017-04-261-1/+1
| | | | | | | | | mtsmfm/disable-referential-integrity-without-superuser-privilege-take-2" This reverts commit c1faca6333abe4b938b98fedc8d1f47b88209ecf, reversing changes made to 8c658a0ecc7f2b5fc015d424baf9edf6f3eb2b0b. See https://github.com/rails/rails/pull/27636#issuecomment-297534129
* Use `SET CONSTRAINTS` for `disable_referential_integrity` without superuser ↵Fumiaki MATSUSHIMA2017-03-261-1/+1
| | | | | | | | | | | | | | | privileges (take 2) Re-create https://github.com/rails/rails/pull/21233 eeac6151a5 was reverted (127509c071b4) because it breaks tests. ---------------- ref: 72c1557254 - We must use `authors` fixture with `author_addresses` because of its foreign key constraint. - Tests require PostgreSQL >= 9.4.2 because it had a bug about `ALTER CONSTRAINTS` and fixed in 9.4.2.
* Revert "Merge pull request #21233 from ↵Rafael Mendonça França2017-01-031-1/+1
| | | | | | | | | | mtsmfm/disable-referential-integrity-without-superuser-privileges" This reverts commit eeac6151a55cb7d5f799e1ae33aa64a839cbc3aa, reversing changes made to 5c40239d3104543e70508360d27584a3e4dc5baf. Reason: Broke the isolated tests. https://travis-ci.org/rails/rails/builds/188721346
* Use `SET CONSTRAINTS` for `disable_referential_integrity` without superuser ↵Fumiaki MATSUSHIMA2016-12-031-1/+1
| | | | | | | | | privileges ref: 72c1557254 - We must use `authors` fixture with `author_addresses` because of its foreign key constraint. - Tests require PostgreSQL >= 9.4.2 because it had a bug about `ALTER CONSTRAINTS` and fixed in 9.4.2.
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-2/+2
|
* improve error message when include assertions failMichael Grosser2016-09-161-3/+3
| | | | | | assert [1, 3].includes?(2) fails with unhelpful "Asserting failed" message assert_includes [1, 3], 2 fails with "Expected [1, 3] to include 2" which makes it easier to debug and more obvious what went wrong
* Add three new rubocop rulesRafael Mendonça França2016-08-161-1/+1
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* Add `Style/EmptyLines` in `.rubocop.yml` and remove extra empty linesRyuta Kamizono2016-08-071-1/+0
|
* modernizes hash syntax in activerecordXavier Noria2016-08-061-16/+16
|
* applies new string literal convention in activerecord/testXavier Noria2016-08-061-10/+10
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Typos in AR testsAkira Matsuda2016-02-031-4/+4
|
* Revert ":cut: remove unnecessary rescue Exceptions"Yves Senn2015-03-061-1/+1
| | | | | | | | | | | | | | | | | This reverts commit ff18049ca6f27deb7e7f955478e1464f8d756332. This broke the AR build for every adapter: 1) Error: AssociationCallbacksTest#test_dont_add_if_before_callback_raises_exception: Exception: You can't add a post 2) Failure: QueryCacheTest#test_query_cache_doesnt_leak_cached_results_of_rolled_back_queries [/Users/senny/Projects/rails/activerecord/test/cases/query_cache_test.rb:235]: Expected: 1 Actual: 0 I'm reverting to get the build green again.
* :cut: remove unnecessary rescue ExceptionsAaron Patterson2015-03-051-1/+1
|
* Build fix when running in isolationArun Agrawal2014-11-141-0/+1
| | | | | `Computer` class needs to be require See #17217 for more details
* Remove unused variableRafael Mendonça França2014-05-011-1/+1
|
* rewrite test to correctly test clear methodeileencodes2014-04-281-2/+2
| | | | | | | Clear should not call callbacks because it clear calls delete_all and then returns self. It should behave the same as delete_all. This test clarifies the goal of the test and tests the correct outcome.
* Replace map.flatten with flat_map in activerecordErik Michaels-Ober2014-03-031-1/+1
|
* let `insert_record` actuall save the object.Aaron Patterson2014-02-251-0/+21
| | | | | | | | | | `before_add` callbacks are fired before the record is saved on `has_and_belongs_to_many` assocations *and* on `has_many :through` associations. Before this change, `before_add` callbacks would be fired before the record was saved on `has_and_belongs_to_many` associations, but *not* on `has_many :through` associations. Fixes #14144
* Revert "Use flat_map { } instead of map {}.flatten"Santiago Pastorino2012-10-051-1/+1
| | | | | | | | | | | This reverts commit abf8de85519141496a6773310964ec03f6106f3f. We should take a deeper look to those cases flat_map doesn't do deep flattening. irb(main):002:0> [[[1,3], [1,2]]].map{|i| i}.flatten => [1, 3, 1, 2] irb(main):003:0> [[[1,3], [1,2]]].flat_map{|i| i} => [[1, 3], [1, 2]]
* Use flat_map { } instead of map {}.flattenSantiago Pastorino2012-10-051-1/+1
|
* please use ruby -I lib:test path/to/test.rb, or export RUBY_OPTAaron Patterson2011-06-061-1/+1
|
* Refactor Active Record test connection setup. Please see the ↵Jon Leighton2011-06-041-1/+1
| | | | RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
* Verify that when has_many associated objects are destroyed via :dependent => ↵Jon Leighton2010-12-311-0/+9
| | | | :destroy, when the parent is destroyed, the callbacks are run
* removing unused variablesAaron Patterson2010-10-201-2/+2
|
* removing unused models from testsSubba Rao Pasupuleti2010-07-211-2/+0
| | | | | | [#5153 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Make HABTM#create behave the same as << with after_add callbacks. Closes ↵Michael Koziarski2008-04-041-0/+15
| | | | | | #11374 [freels] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9224 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Merge branch 'ar-test-cleanup' of git://git.geeksomnia.com/railsJeremy Kemper2008-01-211-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8681 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Move tests to casesJeremy Kemper2008-01-181-0/+146
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8660 5ecf4fe2-1ee6-0310-87b1-e25e094e27de