aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* | Deprecate force association reload by passing truePrem Sichanugrist2015-07-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is to simplify the association API, as you can call `reload` on the association proxy or the parent object to get the same result. For collection association, you can call `#reload` on association proxy to force a reload: @user.posts.reload # Instead of @user.posts(true) For singular association, you can call `#reload` on the parent object to clear its association cache then call the association method: @user.reload.profile # Instead of @user.profile(true) Passing a truthy argument to force association to reload will be removed in Rails 5.1.
* | add `extend` option on `has_and_belongs_to_many`.keepcosmos2015-05-261-0/+15
| |
* | deprecate `Relation#uniq` use `Relation#distinct` instead.Yves Senn2015-05-261-5/+5
|/ | | | | | | | | See #9683 for the reasons we switched to `distinct`. Here is the discussion that triggered the actual deprecation #20198. `uniq`, `uniq!` and `uniq_value` are still around. They will be removed in the next minor release after Rails 5.
* Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-291-1/+1
|
* Allow habtm class_name option to be consistent with other associationsshiksha2014-11-131-0/+10
|
* Ensure HABTM relationships produce valid class names (Fixes #17119)Sammy Larbi2014-11-091-1/+10
|
* Ignore SCHEMA queries in some habtm testsAkira Matsuda2014-08-141-4/+4
|
* 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-191-0/+9
| | | | | | | | | | | | | | | 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
* just use `assert`Aaron Patterson2014-06-021-1/+1
|
* Fix redefine a has_and_belongs_to_many inside inherited classArthur Neves2014-05-271-1/+15
| | | | | | | | | After ad7b5efb55bcc2e0ccd3e7f22a81e984df8676d1, which changed how has_an_belongs_to_many used to work, we start raising an error when redefining the same has_an_belongs_to_many association. This commits fix that regression. [Fixes #14983]
* Fix how to compute class name on habtm namespaced.Kassio Borges2014-05-131-0/+12
| | | | | | Thank's for @laurocaetano for the help with tests. :smiley: Fixes #14709
* set a constant for the "anonymous" habtm model fixes #15022Aaron Patterson2014-05-081-0/+6
| | | | | I wanted the middle model to be anonymous, but we have to give it a name for marshal support. :'(
* Fixed HABTM's CollectionAssociation sizeFred Wu2014-05-081-0/+18
| | | | | HABTM should fall back to using the normal CollectionAssociation's size calculation if the collection is not cached or loaded. This addresses both #14913 and #14914 for master.
* Fix custom join_table name on habtm reflectionsKassio Borges2014-04-251-0/+5
| | | | | | When used a custom join_table name on a habtm, rails was not saving it on Reflections. This causes a problem when rails loads fixtures, because it uses the reflections to set database with fixtures.
* Obey `validate: false` option for habtmCarlos Antonio da Silva2014-03-141-0/+24
| | | | Fixes #14383.
* fix HABTM w/out primary key errors on destructionKevin Casey2014-02-021-0/+10
|
* make sure cached table name is a string. fixes #12582Aaron Patterson2013-12-121-0/+7
|
* Squashed commit of the following:Aaron Patterson2013-10-011-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 02d3b059608c30e98136fde78bc710928f080566 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Mon Sep 30 15:31:39 2013 -0700 habtm works in terms of hm:t commit 71ac336bbb41f5047a4ee307883a95eca7195742 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Mon Sep 30 15:27:07 2013 -0700 passing before_add callbacks commit d846a7bf9872a79c3aa8082917abe806278fa159 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri Sep 27 17:57:53 2013 -0700 reducing diff against master commit 96bd97de47d61a71c368ae367bc59a2dbec3c9ab Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri Sep 27 17:52:35 2013 -0700 fixing more tests commit 0620399fc231df87c5f08664db1c37e5c1fa5a05 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri Sep 27 17:32:52 2013 -0700 self-referential tables in hm:t are allowed to have the same pk commit 48eb90e27921d10b6ba3e400ab2c784ed75d5ec4 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri Sep 27 17:03:19 2013 -0700 translating more options commit 5cace7b2cb546fd6b096543bfc49c4b7197ad21a Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri Sep 27 17:01:02 2013 -0700 handling more hm:t cases commit 69985ca2cabff2c3f58f5d0a7eb12d7b414c1a01 Merge: d417ec8 3e0a60e Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri Sep 27 16:57:12 2013 -0700 Merge branch 'master' into rmhbtm * master: (21 commits) adding a test to demonstrate how to use STI subclasses on the far right side of a hm:t association along with preloading. Fixed grammatical typo in configuring.md guide. Getting Started Guide: Fix code container in Chapter 5.2 [ci-skip] Getting Started Guide: Update sentence in Chapter 5.8 [ci-skip] Add new line after create action on CommentsController code example Adds template dependencies rake task from cache_digests gem. [ci skip] Update scaffold output and change some words. [ci skip] escape unintended url in docs Getting Started Guide: post.rb -> Post [ci skip] Add missing periods and update link name and some wording. quote `false` reference in querying guide. Getting Started Guide: update link_to string argument to use single-quote mark, following document style [ci skip] Fix small typo in docs changelog entry fix .find when inverse is set update changelog for #12359 Make sure inverse_of is visible on the has_many callbacks Getting Started Guide: posts_controller -> PostsController [ci skip] [ci skip] Correct the explanation of the example for find_or_create_by when used with create_with in ActiveRecord Querying guide added "id: false" to HABTM join table example ... commit d417ec82e8f83c32124d1c1a19824d023cfdf015 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Wed Sep 25 16:49:08 2013 -0700 another case is passing commit 5c68280500962e4b2b6819dd863ebe8b398e5834 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Wed Sep 25 16:21:22 2013 -0700 this seems to work commit e458c5e55c04a2444e96aca1ff192be42bc4ce7f Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Wed Sep 25 16:13:07 2013 -0700 add another case commit fc6203b0d49c847b8efb1cc33d358897625f2115 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Wed Sep 25 15:51:45 2013 -0700 delete center records on habtm commit 9af5156098f6bc8f8ce8eb559a51137960b4938b Merge: 3a60b03 e2fd64f Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Wed Sep 25 11:33:13 2013 -0700 Merge branch 'master' into rmhbtm * master: (100 commits) remove initialize method extract association resetting to a method hash insertion order doesn't matter anymore, so only loop over the owners once always populate the preloaded records instance variable so we can remove the @associated_records_by_owner ivar keep preloaded records in a list rather than extract from a hash Getting Started Guide: Hello Rails! -> Hello, Rails! and wrap code tag push slice loading to it's own method so we can remove the type casting code Add CHANGELOG entry for #12344 Add regression test to #12343 Fix typo in number_to_human docs: you -> your guarantee that `klass` is not nil inside the preloader objects [Documentation] Add a missing validation to I18n docs Use the given name in html_options for the hidden field in collection_check_boxes eliminate unused ivar all records have a preloaded, so eliminate that conditional eliminate the `loaded?` conditional push preloaded test up to the factory method so we can eliminate conditionals from the individual preloaded classes assign_attributes should return if argument is blank. No need the else clause Use join to concat the both side of the AST ... commit 3a60b038a40532397b6c204dfb09d6d43a9336ac Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Wed Sep 18 17:50:11 2013 -0700 start with a clean slate commit f30d3631af11ea6144d3ae7a068a7c0072e93a82 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Wed Sep 18 17:30:59 2013 -0700 make sure the class name goes on the rhs belongs_to commit f7516b724014504ddb2e706fea1b5438dc5332c3 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Wed Sep 18 16:31:40 2013 -0700 remove unused variable commit 61ffc5b9854dc2fe83ee502b17ba8028270ff8a7 Merge: 6cf41cd 460eb83 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Wed Sep 18 16:25:17 2013 -0700 Merge branch 'master' into rmhbtm * master: support objects with blank string primary keys ActiveRecord::Base#<=> has been removed. Primary keys may not be in order, or even be numbers, so sorting by id doesn't make sense. Please use `sort_by` and specify the attribute you wish to sort with. For example, change: do what the superclass does in the case that objects do not match commit 6cf41cd98a82e6f4fe6d868ad323df3d72a9748f Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Wed Sep 18 15:06:28 2013 -0700 heating up habtm cache commit d7f6c3aa491f27ba71fdb2b9d0b9d1780664f4dc Merge: c68c904 56bfd8a Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Wed Sep 18 14:07:51 2013 -0700 Merge branch 'master' into rmhbtm * master: (58 commits) Fix an issue where router can't recognize downcased url encoding path. There's no need to do this Remove tzinfo dependency from Action Pack [ci skip] Improve readability of 4.3's NOTE in migration.md. Removes unused code related to DatabaseTasks. [ci skip] Consistency wording of 9.6 in form_helpers.md [ci skip] Update plugins.md Removing ActiveSupport::Concern, it's not needed Fixing comment typo in ActionController::Base Don't require using application_name before options Collapse where constraints to one where constraint Custom flash should be defined only for the class that defines it and it's subclasses. Fix typos: the indefinite articles(a -> an) Missing destroy command Update 3_2_release_notes.md Add CHANGELOG entry for #11698 Add CHANGELOG entry for #12149 Use the Rails binary when generating task Remove unnecessary loop "generates" applies to "collection radio" so it should be singular ... commit c68c904866ef9562c3bd9b54574206a416184414 Merge: 0f5d8e0 71cf717 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Wed Sep 11 17:45:53 2013 -0700 Merge branch 'master' into rmhbtm * master: these are not real developer objects, so counting them doesn't make sense. Let's load the object to ensure it's an array and count the array. Remove conditional adding a new method Fix inverted conditional Remove invalid comment Check if the SQL is not a prepared statement Whitespaces Revert "Add meta tag with charset information to application layout." Avoid empty transaction from setting has_one association on new record. Reduce Duration#inspect to a single series of transformations Relation#merge should not lose readonly(false) flag. Reduce allocations when extracting AR models Perf: avoid dupes add fallback logic for coders commit 0f5d8e0febd3128cf4121ff36f1764b9284d9f7d Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Wed Sep 11 11:43:29 2013 -0700 everything works with extensions commit d003c103b5908fb3a6427f39bddd1748ef2c2576 Merge: 5768c38 7e0cac1 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Wed Sep 11 11:23:59 2013 -0700 Merge branch 'master' into rmhbtm * master: fix deleting join models with no pk remove sentence err [ci skip] 'previous version of Rails' is gramatically incorrect Add meta tag with charset information to application layout. add a comment for sanity of other people to come commit 5768c38d53fd66a97814faaea8e07c70722b310f Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Tue Sep 10 15:11:05 2013 -0700 habtms with a scope seem to be working commit 5ee9108d95c544d4befd682a72139383d0780d68 Merge: d5478e6 e64b5da Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Tue Sep 10 11:55:48 2013 -0700 Merge branch 'master' into rmhbtm * master: ask the association for records rather than calling `send` commit d5478e64bbf80337ec35462368edabb373feeb74 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Tue Sep 10 11:54:39 2013 -0700 ask the association for records rather than calling `send` commit 93020bc1ad51363c3f400370f91c9494690dcea8 Merge: 11b3d5f d68419a Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Tue Sep 10 11:30:03 2013 -0700 Merge branch 'master' into rmhbtm * master: Use Ruby 2.0 caller_locations instead of caller if available Update Rails 3.2.x guide link [ci skip] Be sure to restore the default I18n.locale after changed its value in a test Fixes typo in Object#try! More unused associations in AR test models :scissors: [ci skip] change function def self.table_name to self.table_name Clean up unused associations in AR test model Reset ActionView::Base.logger instead of AC::Base.logger Refactor handling of action normalization Don't mutate the Base settings by merge!ing the given value Make AC standalone rendering work use assert_empty in activemodel conditional validation test cases Removed unused modules and classes Removed unnecessary require Remove helper fixtures not used in any test Back AV description in gemspec Fix order dependent test grab executable from rubygems Fixed API task file commit 11b3d5fa45b57fc4e7dddb09be583498b120b185 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Mon Sep 9 16:19:48 2013 -0700 change query count since we are using hm:t associations commit f59daebedab3ed13f31c99244ff71a4a5d6e554b Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Mon Sep 9 15:35:07 2013 -0700 delegate compute_type to a real AR class commit c84a40d2ed76e5843b994c5a2b9e29ced3816511 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Mon Sep 9 15:29:51 2013 -0700 define callbacks with the builder commit d08b1b6b3efc9ed8b0d5476892f048fbffb39e40 Merge: acebec1 0c5d0be Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Mon Sep 9 15:17:40 2013 -0700 Merge branch 'master' into rmhbtm * master: let the class cache object clean up user input make @bitsweat happy. :heart: commit acebec128e108ac2b4855e540d8764629670cb83 Merge: 2de68a4 e1cbd42 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Mon Sep 9 14:47:30 2013 -0700 Merge branch 'master' into rmhbtm * master: stop using deprecated api in the tests commit 2de68a464641f76067743957f889ac87dff395a0 Merge: 7504df9 1385ae1 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Mon Sep 9 14:34:37 2013 -0700 Merge branch 'master' into rmhbtm * master: Remove BasicRendering tests Remove remaining coupling with AV in MimeResponds Remove BasicRendering and remove template functionality from AbsC::Rendering Improves a sentence in guides/security [ci skip] Change link name of Rails i18n wiki. Typo in Changelog. Fix fixtures regression that required table names to map to classes only, not class names Use MiniTest::Unit::TestCase instead of Minitest::Test Use Ruby on Rails Coding Conventions for code examples in the guides commit 7504df92f21ed3d5da7c2760d760f026728ed04d Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Mon Sep 9 14:34:02 2013 -0700 fake class name should be a valid class name commit 6609620ea86dc0fb7c4bbfb0db950f6e3fc75b56 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri Sep 6 15:52:03 2013 -0700 move another habtm commit 2c95a36e2c3dfe92f2930f3cca44bc4452732a23 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri Sep 6 15:50:18 2013 -0700 use the habtm name to generate the rhs name on the join model commit bd963f720b1db19b0bec186bc33bef9203d8b011 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri Sep 6 15:47:29 2013 -0700 don't hardcode the name commit 461759e2caf66f23dca4eff988648bf769a2b533 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri Sep 6 15:45:27 2013 -0700 we do not need to specify the fk commit 9c223f01db6e36adbb7570e2aa1bcaec1d142c87 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri Sep 6 15:44:08 2013 -0700 just call the left side :left_side commit 5661622a82154eff877fe0993bfffad13dacad7a Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri Sep 6 15:40:36 2013 -0700 initial habtm implementation is working
* these are not real developer objects, so counting them doesn't makeAaron Patterson2013-09-111-1/+1
| | | | | sense. Let's load the object to ensure it's an array and count the array.
* add a comment for sanity of other people to comeAaron Patterson2013-09-101-0/+8
|
* Revert change on ActiveRecord::Relation#order method that prepends newRafael Mendonça França2013-07-291-2/+2
| | | | | | | | | | | | | | | order on the old ones The previous behavior added a major backward incompatibility since it impossible to have a upgrade path without major changes on the application code. We are taking the most conservative path to be consistent with the idea of having a smoother upgrade on Rails 4. We are reverting the behavior for what was in Rails 3.x and, if needed, we will implement a new API to prepend the order clauses in Rails 4.1.
* Remove redundant test about `push_with_attributes` removal.Vipul A M2013-07-091-7/+0
|
* Removed support for deprecated `delete_sql` in associations.Neeraj Singh2013-07-031-25/+0
|
* Removed support for deprecated `finder_sql` in associations.Neeraj Singh2013-07-021-26/+0
|
* Removed support for deprecated `counter_sql`Neeraj Singh2013-07-021-21/+0
|
* Removed deprecated options for assocationsNeeraj Singh2013-07-021-12/+0
| | | | | Deprecated options `delete_sql`, `insert_sql`, `finder_sql` and `counter_sql` have been deleted.
* rename `Relation#uniq` to `Relation#distinct`. `#uniq` still works.Yves Senn2013-03-151-1/+1
| | | | | | | | The similarity of `Relation#uniq` to `Array#uniq` is confusing. Since our Relation API is close to SQL terms I renamed `#uniq` to `#distinct`. There is no deprecation. `#uniq` and `#uniq!` are aliases and will continue to work. I also updated the documentation to promote the use of `#distinct`.
* Revert "Merge pull request #8989 from robertomiranda/use-rails-4-find-by"Guillermo Iguaran2013-01-181-8/+8
| | | | | This reverts commit 637a7d9d357a0f3f725b0548282ca8c5e7d4af4a, reversing changes made to 5937bd02dee112646469848d7fe8a8bfcef5b4c1.
* User Rails 4 find_byrobertomiranda2013-01-181-8/+8
|
* Merge and add tests related to 5215Vipul A M2012-11-121-6/+11
|
* Count returns 0 without querying if parent is not savedFrancesco Rodriguez2012-10-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Patches `CollectionAssociation#count` to return 0 without querying if the parent record is new. Consider the following code: class Account has_many :dossiers end class Dossier belongs_to :account end a = Account.new a.dossiers.build # before patch a.dossiers.count # SELECT COUNT(*) FROM "dossiers" WHERE "dossiers"."account_id" IS NULL # => 0 # after a.dosiers.count # fires without sql query # => 0 Fixes #1856.
* Remove ActiveRecord::Base.to_aJon Leighton2012-08-031-2/+2
| | | | | On reflection, it seems like a bit of a weird method to have on ActiveRecord::Base, and it shouldn't be needed most of the time anyway.
* Deprecate :finder_sql, :counter_sql, :insert_sql, :delete_sql.Jon Leighton2012-08-011-6/+21
|
* Revert "Remove :finder_sql, :counter_sql, :insert_sql, :delete_sql."Jon Leighton2012-08-011-0/+69
| | | | | | | | | This reverts commit 3803fcce26b837c0117f7d278b83c366dc4ed370. Conflicts: activerecord/CHANGELOG.md It will be deprecated only in 4.0, and removed properly in 4.1.
* AR::Relation#order: make new order prepend old oneBogdan Gusiev2012-07-311-2/+2
| | | | | | | User.order("name asc").order("created_at desc") # SELECT * FROM users ORDER BY created_at desc, name asc This also affects order defined in `default_scope` or any kind of associations.
* Deprecate ActiveRecord::Base.scoped.Jon Leighton2012-07-271-5/+5
| | | | | | | It doesn't serve much purpose now that ActiveRecord::Base.all returns a Relation. The code is moved to active_record_deprecated_finders.
* ActiveRecord::Base.all returns a Relation.Jon Leighton2012-07-271-7/+7
| | | | | | | | | | | Previously it returned an Array. If you want an array, call e.g. `Post.to_a` rather than `Post.all`. This is more explicit. In most cases this should not break existing code, since Relations use method_missing to delegate unknown methods to #to_a anyway.
* Deprecate update_column in favor of update_columns.Rafael Mendonça França2012-07-241-1/+1
| | | | Closes #1190
* Remove :finder_sql, :counter_sql, :insert_sql, :delete_sql.Jon Leighton2012-07-201-69/+0
|
* Improve the derivation of HABTM assocation join table namesAndrew White2012-06-221-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve the derivation of HABTM join table name to take account of nesting. It now takes the table names of the two models, sorts them lexically and then joins them, stripping any common prefix from the second table name. Some examples: Top level models (Category <=> Product) Old: categories_products New: categories_products Top level models with a global table_name_prefix (Category <=> Product) Old: site_categories_products New: site_categories_products Nested models in a module without a table_name_prefix method (Admin::Category <=> Admin::Product) Old: categories_products New: categories_products Nested models in a module with a table_name_prefix method (Admin::Category <=> Admin::Product) Old: categories_products New: admin_categories_products Nested models in a parent model (Catalog::Category <=> Catalog::Product) Old: categories_products New: catalog_categories_products Nested models in different parent models (Catalog::Category <=> Content::Page) Old: categories_pages New: catalog_categories_content_pages Also as part of this commit the validity checks for HABTM assocations have been moved to ActiveRecord::Reflection One side effect of this is to move when the exceptions are raised from the point of declaration to when the association is built. This is consistant with other association validity checks.
* Fix fragile #assert_queries implementation and usages.Steve Jorgensen2012-06-091-2/+5
| | | | | | | | | Several tests that passed when run in the order they are loaded by rake test were failing when run in different sequences due to problems with the implementation of assert_queries and assert_no_queries as well as incorrect assumptions made about how many queries might be executed by a database adapter in various cases.
* fix #delete_all with habtm with :delete_sqlJon Leighton2012-05-181-0/+6
|
* quarantine deprecated testsJon Leighton2012-05-181-20/+0
|
* Merge pull request #5453 from ↵Aaron Patterson2012-05-161-0/+6
|\ | | | | | | | | JonRowe/patch_uniq_has_and_belongs_to_many_when_already_loaded When Active Record has already loaded a unique association `.size` returns the wrong number.
| * when using a preloaded array and the uniq flag is set then return the size ↵Jon Rowe2012-03-151-0/+6
| | | | | | | | of the uniq array
* | Remove #=== quirkJon Leighton2012-05-111-5/+0
| | | | | | | | Makes it consistent with Relation. Can't see a use for this.
* | CollectionProxy < RelationJon Leighton2012-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This helps bring the interfaces of CollectionProxy and Relation closer together, and reduces the delegation backflips we need to perform. For example, first_or_create is defined thus: class ActiveRecord::Relation def first_or_create(...) first || create(...) end end If CollectionProxy < Relation, then post.comments.first_or_create will hit the association's #create method which will actually add the new record to the association, just as post.comments.create would. With the previous delegation, post.comments.first_or_create expands to post.comments.scoped.first_or_create, where post.comments.scoped has no knowledge of the association.
* | more deprecations manually fixedJon Leighton2012-04-271-7/+7
| |
* | find and replace deprecated keysJon Leighton2012-04-271-7/+7
| |