Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Merge branch 'master' of github.com:lifo/docrails | Vijay Dev | 2012-05-19 | 1 | -10/+24 |
|\ | |||||
| * | move docs from CollectionAssociation to CollectionProxy | Francesco Rodriguez | 2012-05-18 | 1 | -113/+1 |
| | | |||||
| * | remove incorrect example of CollectionAssociation#empty? | Francesco Rodriguez | 2012-05-18 | 1 | -17/+0 |
| | | |||||
| * | add docs to CollectionAssociation#empty? | Francesco Rodriguez | 2012-05-18 | 1 | -3/+32 |
| | | |||||
| * | add docs to CollectionAssociation#any? | Francesco Rodriguez | 2012-05-18 | 1 | -0/+30 |
| | | |||||
| * | add examples to CollectionAssociation#concat | Francesco Rodriguez | 2012-05-18 | 1 | -3/+14 |
| | | |||||
| * | fix CollectionAssociation docs | Francesco Rodriguez | 2012-05-17 | 1 | -1/+1 |
| | | |||||
| * | add example to CollectionAssociation#destroy_all | Francesco Rodriguez | 2012-05-17 | 1 | -3/+14 |
| | | |||||
| * | add more explanation to CollectionAssociation docs | Francesco Rodriguez | 2012-05-17 | 1 | -0/+4 |
| | | |||||
| * | add CollectionAssociation hierarchy | Francesco Rodriguez | 2012-05-17 | 1 | -2/+7 |
| | | |||||
| * | add docs to CollectionAssociation#many? | Francesco Rodriguez | 2012-05-17 | 1 | -1/+34 |
| | | |||||
| * | fix CollectionAssociation#replace docs | Francesco Rodriguez | 2012-05-17 | 1 | -3/+3 |
| | | |||||
| * | Add docs to CollectionAssociation#replace | Francesco Rodriguez | 2012-05-17 | 1 | -3/+23 |
| | | |||||
* | | Ensure that CollectionAssociation#replace returns proper target | Piotr Sarnacki | 2012-05-19 | 1 | -1/+1 |
| | | | | | | | | | | | | | | | | 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. | ||||
* | | no longer need #delete_all_on_destroy | Jon Leighton | 2012-05-18 | 1 | -7/+0 |
| | | |||||
* | | Perf: Don't load the association for #delete_all. | Jon Leighton | 2012-05-18 | 1 | -2/+12 |
|/ | | | | Bug #6289 | ||||
* | Merge pull request #5453 from ↵ | Aaron Patterson | 2012-05-16 | 1 | -2/+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 Rowe | 2012-03-15 | 1 | -2/+6 |
| | | | | | | | | of the uniq array | ||||
* | | Fix CollectionAssociation#replace to return new target (closes #6231) | Piotr Sarnacki | 2012-05-16 | 1 | -0/+2 |
| | | |||||
* | | CollectionProxy < Relation | Jon Leighton | 2012-05-11 | 1 | -7/+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. | ||||
* | | Some refactor for association. | kennyj | 2012-04-12 | 1 | -1/+1 |
|/ | | | | | | | * Remove unused association_class method. * Remove a unnecessary assignment. * Move @updated to BelongsToAssociation that only reference this instance variable. * Reset @stale_state at the reset method. I think this place is right place. | ||||
* | In AR depths use &:to_i before :uniq to process mixed arrays likes ["1", 1] ↵ | Alexey Vakhov | 2012-03-09 | 1 | -1/+1 |
| | | | | correct | ||||
* | ids_reader method fixed, test added to has_many association | gregolsen | 2012-01-31 | 1 | -1/+1 |
| | |||||
* | Remove Array.wrap calls in ActiveRecord | Rafael Mendonça França | 2012-01-06 | 1 | -3/+1 |
| | |||||
* | Use 1.9 way | Santiago Pastorino | 2012-01-05 | 1 | -6/+1 |
| | |||||
* | bypass preloading for ids_reader | Sergey Nartimov | 2011-12-18 | 1 | -2/+10 |
| | | | | | when fetching ids for a collection, bypass preloading to avoid the unnecessary performance overhead | ||||
* | Fix #3672 again (dependent: delete_all perf) | Jon Leighton | 2011-12-14 | 1 | -0/+7 |
| | |||||
* | load has_many associations keyed off a custom primary key if that key is ↵ | Brian Samson | 2011-11-25 | 1 | -1/+1 |
| | | | | present but the record is unsaved | ||||
* | Merge pull request #3507 from jmazzi/issue-3503 | Jeremy Kemper | 2011-11-03 | 1 | -2/+6 |
| | | | | Preserve SELECT columns on the COUNT for finder_sql when possible | ||||
* | Changed a few instances of of words in the API docs written in British ↵ | Oemuer Oezkir | 2011-07-24 | 1 | -1/+1 |
| | | | | | | English to American English(according to Weber) | ||||
* | Fix bug in collection_singular_ids on has many through association with ↵ | Anatoliy Lysenko | 2011-07-06 | 1 | -1/+1 |
| | | | | | | | | | | | | | | | | conditions and includes, when condtions references tables from includes. Test fail because of invalid sql: ActiveRecord::StatementInvalid: SQLite3::SQLException: no such column: comments.id: SELECT "posts".id FROM "posts" INNER JOIN "readers" ON "posts"."id" = "readers"."post_id" WHERE "readers"."person_id" = 1 AND (comments.id is null) Bug described in github#925 This commit will revert fix from https://github.com/rails/rails/commit/3436fdfc12d58925e3d981e0afa61084ea34736c , but tests is ok. Bug described in #6569 ticket. | ||||
* | Fixed CollectionAssociation#find to be compatible with Array#find | Bogdan Gusiev | 2011-07-05 | 1 | -3/+7 |
| | | | | | 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 | -6/+0 |
| | | | | before_initialize callback of the record runs. Fixes #1842. | ||||
* | Replace inline lambdas with named methods | Jon Leighton | 2011-06-12 | 1 | -29/+42 |
| | |||||
* | Don't wrap operations on collection associations in transactions when they ↵ | benedikt | 2011-06-12 | 1 | -3/+9 |
| | | | | are not needed, so the connection adapter does not send empty BEGIN COMMIT transactions blocks to the database. | ||||
* | Don't double assign attributes - closes #1467. | Andrew White | 2011-06-03 | 1 | -1/+0 |
| | |||||
* | Only save the record once when calling create! on a collection association. ↵ | Jon Leighton | 2011-05-31 | 1 | -19/+21 |
| | | | | Fixes #1360. | ||||
* | Implementing @dmathieu's cleaner fix from #1425. Unfortunately he deleted ↵ | Jon Leighton | 2011-05-31 | 1 | -8/+5 |
| | | | | the branch so I cannot just merge it. | ||||
* | Adding comment to work with 1.8.7. Nested Attribute fix. | Arun Agrawal | 2011-05-31 | 1 | -0/+3 |
| | |||||
* | Fix nested attribute for memory record. | Arun Agrawal | 2011-05-31 | 1 | -1/+5 |
| | |||||
* | Remove extra white spaces on ActiveRecord docs. | Sebastian Martinez | 2011-05-23 | 1 | -1/+1 |
| | |||||
* | Pass the attribute and option hashes to build_association | Andrew White | 2011-05-17 | 1 | -2/+6 |
| | | | | | | | 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. | ||||
* | These extra array operations appear to be unnecessary. Reasoning: | Jon Leighton | 2011-05-14 | 1 | -8/+2 |
| | | | | | * It is not necessary to subtract 'id' from the list of copied attributes because record and mem_record are equal, so therefore their id attributes are also equal (so there is no harm in copying it, and this reduces the complexity of the code) * It is not necessary to intersect the attribute names, since record and mem_record are equal, so they have the same id and class, so they have the same columns in the database. If record has non-column attributes then it seems reasonable to also copy them onto mem_record (though I am not sure what situation this would ever happen in) | ||||
* | CollectionAssociation#merge_target_lists should write to the underlying ↵ | Jon Leighton | 2011-05-14 | 1 | -5/+2 |
| | | | | attributes when copying, rather than using the assignment method | ||||
* | An attempt to make CollectionAssociation#merge_target_lists make more sense. | Jon Leighton | 2011-05-14 | 1 | -16/+35 |
| | |||||
* | Instead of doing find(:all) which does scoped.find(:all) which does ↵ | Jon Leighton | 2011-05-13 | 1 | -1/+1 |
| | | | | scoped.all, just do scoped.all. | ||||
* | Remove pointless rescue (it doesn't happen anywhere in the tests, and I ↵ | Jon Leighton | 2011-05-13 | 1 | -9/+1 |
| | | | | can't see a way that it would happen ever) | ||||
* | Modified CollectionAssociation to refer to the new class name. | Michael Ebens | 2011-05-11 | 1 | -1/+1 |
| | |||||
* | Remove unnecessary '|| {}' | Jon Leighton | 2011-05-10 | 1 | -1/+1 |
| | |||||
* | Don't use mass-assignment protection when applying the ↵ | Jon Leighton | 2011-05-10 | 1 | -2/+4 |
| | | | | scoped.scope_for_create. Fixes #481. |