Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | Ensure that CollectionAssociation#replace returns proper target | Piotr Sarnacki | 2012-05-19 | 1 | -2/+2 | |
| | | | | | | | | The fix commited in e2a070c was returning the `new_target`, as a try to return whatever user replaced association with. The problem is, the resulting association target may be ordered differently. In such case we want to return the target that will be later used for that association. | |||||
* | Perf: Don't load the association for #delete_all. | Jon Leighton | 2012-05-18 | 1 | -0/+12 | |
| | | | | Bug #6289 | |||||
* | quarantine deprecated tests | Jon Leighton | 2012-05-18 | 1 | -121/+8 | |
| | ||||||
* | Fix CollectionAssociation#replace to return new target (closes #6231) | Piotr Sarnacki | 2012-05-16 | 1 | -0/+12 | |
| | ||||||
* | Remove #=== quirk | Jon Leighton | 2012-05-11 | 1 | -6/+0 | |
| | | | | Makes it consistent with Relation. Can't see a use for this. | |||||
* | CollectionProxy < Relation | Jon Leighton | 2012-05-11 | 1 | -4/+17 | |
| | | | | | | | | | | | | | | | | | | | | | 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. | |||||
* | Fix issue with private kernel methods and collection associations. Closes #2508 | Carlos Antonio da Silva | 2012-05-02 | 1 | -0/+5 | |
| | | | | | | | | Change CollectionProxy#method_missing to use scoped.public_send, to avoid a problem described in issue #2508 when trying to use class methods with names like "open", that clash with private kernel methods. Also changed the dynamic matcher instantiator to send straight to scoped, to avoid another roundtrip to method_missing. | |||||
* | remove deprecated calls | Jon Leighton | 2012-04-27 | 1 | -2/+2 | |
| | ||||||
* | find and replace deprecated keys | Jon Leighton | 2012-04-27 | 1 | -24/+24 | |
| | ||||||
* | %s/find(:\(first\|last\|all\), \([^()]*\))/scoped(\2).\1/gcI amongst other ↵ | Jon Leighton | 2012-04-27 | 1 | -57/+57 | |
| | | | | things | |||||
* | don't need this test | Jon Leighton | 2012-04-26 | 1 | -5/+0 | |
| | ||||||
* | remove calls to find(:first), find(:last) and find(:all) | Jon Leighton | 2012-04-26 | 1 | -11/+6 | |
| | ||||||
* | remove deprecated #first calls | Jon Leighton | 2012-04-26 | 1 | -12/+1 | |
| | ||||||
* | remove deprecate #calculate calls | Jon Leighton | 2012-04-26 | 1 | -9/+1 | |
| | ||||||
* | remove deprecated #find_in_batches calls | Jon Leighton | 2012-04-26 | 1 | -1/+1 | |
| | ||||||
* | In AR depths use &:to_i before :uniq to process mixed arrays likes ["1", 1] ↵ | Alexey Vakhov | 2012-03-09 | 1 | -0/+7 | |
| | | | | correct | |||||
* | Fix #5069 - Protect foreign key from mass assignment throught association ↵ | Jean Boussier | 2012-03-05 | 1 | -0/+22 | |
| | | | | builder | |||||
* | Merge pull request #4543 from jdelStrother/find_or_init | Jon Leighton | 2012-02-01 | 1 | -0/+12 | |
|\ | | | | | Don't instantiate two objects in collection proxy / find_or_instantiate_by | |||||
| * | Don't instantiate two objects in collection proxy / find_or_instantiator_by | Jonathan del Strother | 2012-01-19 | 1 | -0/+12 | |
| | | ||||||
* | | fix has_one, has_many restrict error message | Manoj | 2012-02-01 | 1 | -1/+1 | |
| | | ||||||
* | | Merge pull request #4791 from gregolsen/reflection_test_fixed | José Valim | 2012-01-31 | 1 | -1/+1 | |
|\ \ | | | | | | | reflection test fixed | |||||
| * | | test_get_ids_for_ordered_association fixed | gregolsen | 2012-01-31 | 1 | -1/+1 | |
| | | | ||||||
* | | | Remove deprecation warnings from tests | Rafael Mendonça França | 2012-01-31 | 1 | -7/+13 | |
|/ / | ||||||
* | | Merge pull request #4783 from gregolsen/ids_reader_fix | Jon Leighton | 2012-01-31 | 1 | -0/+4 | |
|\ \ | | | | | | | ids_reader method fixed, test added to has_many association (for PostgreSQL) | |||||
| * | | ids_reader method fixed, test added to has_many association | gregolsen | 2012-01-31 | 1 | -0/+4 | |
| |/ | ||||||
* | | suggested fixes for :dependent => :restrict deprecation. | Manoj | 2012-01-31 | 1 | -16/+5 | |
| | | ||||||
* | | has_many/has_one, :dependent => :restrict, deprecation added. | Manoj | 2012-01-29 | 1 | -12/+55 | |
|/ | ||||||
* | allow reorder to affect eager loading correctly | Matt Jones + Scott Walker | 2011-12-28 | 1 | -0/+10 | |
| | ||||||
* | load has_many associations keyed off a custom primary key if that key is ↵ | Brian Samson | 2011-11-25 | 1 | -1/+28 | |
| | | | | present but the record is unsaved | |||||
* | Merge pull request #3507 from jmazzi/issue-3503 | Jeremy Kemper | 2011-11-03 | 1 | -0/+15 | |
| | | | | Preserve SELECT columns on the COUNT for finder_sql when possible | |||||
* | Fixed failed test under 1.8.7 as map.keys order in indeterminable | Rocky Jaiswal | 2011-09-28 | 1 | -1/+1 | |
| | ||||||
* | Merge pull request #3030 from htanata/fix_habtm_select_query_method | Jon Leighton | 2011-09-26 | 1 | -0/+8 | |
| | | | | Fix: habtm doesn't respect select query method | |||||
* | CollectionProxy#replace should change the DB records rather than just ↵ | Jon Leighton | 2011-09-26 | 1 | -0/+11 | |
| | | | | mutating the array. Fixes #3020. | |||||
* | Ensure we are not comparing a string with a symbol in ↵ | Jon Leighton | 2011-09-06 | 1 | -0/+10 | |
| | | | | HasManyAssociation#inverse_updates_counter_cache?. Fixes #2755, where a counter cache could be decremented twice as far as it was supposed to be. | |||||
* | Fixed CollectionAssociation#find to be compatible with Array#find | Bogdan Gusiev | 2011-07-05 | 1 | -0/+4 | |
| | | | | | In order to make CollectionAssociation behave closer to Array Add the ability to pass block to #find method just like Array#find does. | |||||
* | Assign the association attributes to the associated record before the ↵ | Jon Leighton | 2011-06-30 | 1 | -0/+7 | |
| | | | | before_initialize callback of the record runs. Fixes #1842. | |||||
* | Make assert_no_queries literally enforce that there are no queries. As in, ↵ | Jon Leighton | 2011-06-12 | 1 | -15/+0 | |
| | | | | not a single line of SQL should be sent to the database, not even stuff that is ignored by assert_queries. The argument being that if you write assert_no_queries, you really do not want there to be any queries. | |||||
* | Refactor tests to be less brittle | Jon Leighton | 2011-06-12 | 1 | -25/+58 | |
| | ||||||
* | Don't wrap operations on collection associations in transactions when they ↵ | benedikt | 2011-06-12 | 1 | -0/+45 | |
| | | | | are not needed, so the connection adapter does not send empty BEGIN COMMIT transactions blocks to the database. | |||||
* | please use ruby -I lib:test path/to/test.rb, or export RUBY_OPT | Aaron Patterson | 2011-06-06 | 1 | -1/+1 | |
| | ||||||
* | Refactor Active Record test connection setup. Please see the ↵ | Jon Leighton | 2011-06-04 | 1 | -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. | |||||
* | added an alias for new to build to the AR collection proxy, this corrects an ↵ | Josh Kalderimis | 2011-06-01 | 1 | -0/+10 | |
| | | | | issue where the collection proxies were not consistent | |||||
* | Tests for issue #1360 | Farley Knight | 2011-05-31 | 1 | -0/+9 | |
| | ||||||
* | Fix problem with loading polymorphic associations which have been defined in ↵ | Jon Leighton | 2011-05-22 | 1 | -0/+7 | |
| | | | | an abstract superclass. Fixes #552. | |||||
* | Pass the attribute and option hashes to build_association | Andrew White | 2011-05-17 | 1 | -0/+13 | |
| | | | | | | | The build_association method was added as an API for plugins to hook into in 1398db0. This commit restores this API and the ability to override class.new to return a subclass based on a virtual attribute in the attributes hash. | |||||
* | CollectionAssociation#merge_target_lists should write to the underlying ↵ | Jon Leighton | 2011-05-14 | 1 | -0/+10 | |
| | | | | attributes when copying, rather than using the assignment method | |||||
* | Add test to specify that attributes from an association's conditions should ↵ | Jon Leighton | 2011-05-10 | 1 | -4/+23 | |
| | | | | be assigned without mass-assignment protection when a record is built on the association. | |||||
* | Don't use mass-assignment protection when applying the ↵ | Jon Leighton | 2011-05-10 | 1 | -0/+9 | |
| | | | | scoped.scope_for_create. Fixes #481. | |||||
* | Add failing tests according to #479. | José Valim | 2011-05-10 | 1 | -0/+15 | |
| | ||||||
* | Add failing tests, according to #480. | José Valim | 2011-05-10 | 1 | -0/+14 | |
| |