Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Remove debug code :bomb: | Rafael Mendonça França | 2012-09-16 | 1 | -1/+0 |
| | |||||
* | Don't preserve SELECT columns on COUNT | Steve Klabnik | 2012-09-16 | 1 | -1/+2 |
| | | | | | | | | | | | | | | | | | | The COUNT clause of a finder_sql relationship is being rewritten from COUNT(*) to COUNT(table_name.*). This does not appear to be valid syntax in MySQL: ``` mysql> SELECT COUNT( table_name.* ) FROM `table_name`; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* ) FROM `table_name`' at line 1 ``` This fixes the bug, as well as adding tests so we don't re-introduce it in the future. Fixes #3956. | ||||
* | Use inversed parent for first and last child of has_many association | brainopia | 2012-08-18 | 1 | -1/+1 |
| | |||||
* | Changing AR:CollectionAssociation#empty? to use #exists? | beerlington | 2012-08-05 | 1 | -3/+11 |
| | | | | | COUNT(*) queries can be slow in PostgreSQL, #exists? avoids this by selecting a single record. | ||||
* | s/scoped/scope/ | Jon Leighton | 2012-08-01 | 1 | -10/+10 |
| | |||||
* | Deprecate :finder_sql, :counter_sql, :insert_sql, :delete_sql. | Jon Leighton | 2012-08-01 | 1 | -1/+1 |
| | |||||
* | Revert "Remove :finder_sql, :counter_sql, :insert_sql, :delete_sql." | Jon Leighton | 2012-08-01 | 1 | -16/+69 |
| | | | | | | | | | This reverts commit 3803fcce26b837c0117f7d278b83c366dc4ed370. Conflicts: activerecord/CHANGELOG.md It will be deprecated only in 4.0, and removed properly in 4.1. | ||||
* | we don't need this arg | Jon Leighton | 2012-07-20 | 1 | -2/+2 |
| | |||||
* | Remove :finder_sql, :counter_sql, :insert_sql, :delete_sql. | Jon Leighton | 2012-07-20 | 1 | -69/+16 |
| | |||||
* | Remove obsolete line. | Jon Leighton | 2012-07-20 | 1 | -1/+0 |
| | | | | | | | | This code is broken (it should say association_scope.uniq_value rather than options[:uniq]) but the tests still pass. I think it is designed to uniq-ify associations using finder_sql. However, I am about to remove that anyway. | ||||
* | Represent association scope options as AR::Relations insternally. | Jon Leighton | 2012-07-13 | 1 | -5/+5 |
| | |||||
* | Set the hash value directly instead of using merge! | Carlos Antonio da Silva | 2012-06-21 | 1 | -1/+1 |
| | |||||
* | Remove unneeded code since pluck is respecting joins now | Rafael Mendonça França | 2012-06-19 | 1 | -12/+1 |
| | |||||
* | Add support for CollectionAssociation#delete by Fixnum or String | Francesco Rodriguez | 2012-05-28 | 1 | -0/+1 |
| | | | | | | | | | | | | | | | | | | | | | | | | I found the next issue between CollectionAssociation `delete` and `destroy`. class Person < ActiveRecord::Base has_many :pets end person.pets.destroy(1) # => OK, returns the destroyed object person.pets.destroy("2") # => OK, returns the destroyed object person.pets.delete(1) # => ActiveRecord::AssociationTypeMismatch person.pets.delete("2") # => ActiveRecord::AssociationTypeMismatch Adding support for deleting with a fixnum or string like `destroy` method. | ||||
* | 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 |
| |