Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | ActiveRecord::Relation#pluck method | Bogdan Gusiev | 2011-11-30 | 1 | -1/+1 |
| | |||||
* | Merge pull request #3636 from joshsusser/master | Jon Leighton | 2011-11-29 | 6 | -21/+22 |
|\ | | | | | association methods are now generated in modules | ||||
| * | avoid warnings | Josh Susser | 2011-11-27 | 6 | -15/+15 |
| | | | | | | | | | | | | | | This change uses Module.redefine_method as defined in ActiveSupport. Making Module.define_method public would be as clean in the code, and would also emit warnings when redefining an association. That is pretty messy given current tests, so I'm leaving it for someone else to decide what approach is better. | ||||
| * | use GeneratedFeatureMethods module for associations | Josh Susser | 2011-11-27 | 2 | -7/+13 |
| | | |||||
| * | association methods are now generated in modules | Josh Susser | 2011-11-15 | 7 | -30/+25 |
| | | | | | | | | | | | | | | | | | | | | Instead of generating association methods directly in the model class, they are generated in an anonymous module which is then included in the model class. There is one such module for each association. The only subtlety is that the generated_attributes_methods module (from ActiveModel) must be forced to be included before association methods are created so that attribute methods will not shadow association methods. | ||||
* | | load has_many associations keyed off a custom primary key if that key is ↵ | Brian Samson | 2011-11-25 | 2 | -1/+5 |
| | | | | | | | | present but the record is unsaved | ||||
* | | Perf fix | Jon Leighton | 2011-11-19 | 1 | -2/+6 |
|/ | | | | | | | If we're deleting all records in an association, don't add a IN(..) clause to the query. Fixes #3672. | ||||
* | Use uniq instead of manually putting a DISTINCT in the query | Jon Leighton | 2011-11-05 | 1 | -14/+2 |
| | |||||
* | 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 | ||||
* | Memoize through association | Jon Leighton | 2011-11-03 | 1 | -8/+11 |
| | |||||
* | Remove all revelant through records. | Jon Leighton | 2011-11-03 | 1 | -9/+9 |
| | | | | | | | | | If a record is removed from a has_many :through, all of the join records relating to that record should also be removed from the through association's target. (Previously the records were removed in the database, but only one was removed from the in-memory target array.) | ||||
* | Fix adding multiple instances of the same record to a has_many :through. | Jon Leighton | 2011-11-03 | 1 | -21/+43 |
| | | | | Fixes #3425. | ||||
* | Fix #3247. | Jon Leighton | 2011-11-03 | 1 | -1/+1 |
| | | | | | Fixes creating records in a through association with a polymorphic source type. | ||||
* | Merge pull request #3030 from htanata/fix_habtm_select_query_method | Jon Leighton | 2011-09-26 | 1 | -4/+0 |
| | | | | Fix: habtm doesn't respect select query method | ||||
* | Fix belongs_to polymorphic with custom primary key on target. | Jon Leighton | 2011-09-26 | 2 | -2/+11 |
| | | | | Closes #3104. | ||||
* | CollectionProxy#replace should change the DB records rather than just ↵ | Jon Leighton | 2011-09-26 | 1 | -1/+1 |
| | | | | mutating the array. Fixes #3020. | ||||
* | Don't include any of includes, preload, joins, eager_load in the through ↵ | Jon Leighton | 2011-09-07 | 1 | -1/+1 |
| | | | | association scope. | ||||
* | Nested through associations: preloads from the default scope of a through ↵ | Jon Leighton | 2011-09-06 | 1 | -1/+1 |
| | | | | model should not be included in the association scope. (We're already excluding includes.) Fixes #2834. | ||||
* | Don't find belongs_to target when the foreign_key is NULL. Fixes #2828 | Georg Friedrich | 2011-09-05 | 1 | -0/+4 |
| | |||||
* | The join_nodes must be passed to the JoinDependency initializer and ↵ | Jon Leighton | 2011-08-29 | 1 | -6/+12 |
| | | | | therefore counted by the alias tracker. This is because the association_joins are aliased on initialization and then the tables are cached, so it is no use to alias the join_nodes later. Fixes #2556. | ||||
* | Ensure empty has_many :through association preloaded via joins is marked as ↵ | Jon Leighton | 2011-08-15 | 1 | -3/+2 |
| | | | | loaded. Fixes #2054. | ||||
* | Fix private methods which are delegated to. This previously worked because ↵ | Jon Leighton | 2011-08-15 | 2 | -13/+13 |
| | | | | Module#delegate previously ignored method visibility. | ||||
* | Make it the responsibility of the connection to hold onto an ARel visitor ↵ | Jon Leighton | 2011-08-08 | 2 | -3/+3 |
| | | | | for generating SQL. This improves the code architecture generally, and solves some problems with marshalling. Adapter authors please take note: you now need to define an Adapter.visitor_for method, but it degrades gracefully with a deprecation warning for now. | ||||
* | Add a proxy_association method to association proxies, which can be called ↵ | Jon Leighton | 2011-07-27 | 1 | -6/+10 |
| | | | | by association extensions to access information about the association. This replaces proxy_owner etc with proxy_association.owner. | ||||
* | 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 exception if old and new targets are both nil. Fixes #1471. | Jon Leighton | 2011-07-12 | 1 | -1/+1 |
| | |||||
* | Merge branch 'master' of git://github.com/lifo/docrails | Xavier Noria | 2011-07-09 | 1 | -1/+1 |
|\ | |||||
| * | find(:first) => first | Akira Matsuda | 2011-07-08 | 1 | -1/+1 |
| | | |||||
* | | Destroy association habtm record before destroying the record itself. Fixes ↵ | Tomas D'Stefano | 2011-07-08 | 1 | -12/+10 |
| | | | | | | | | issue #402. | ||||
* | | Ensure that the foreign key gets set when doing record.create_association or ↵ | Jon Leighton | 2011-07-08 | 1 | -2/+11 |
| | | | | | | | | record.create_association. Fixes #1960. | ||||
* | | Merge pull request #1120 from lysenko/collection_singular_ids | Santiago Pastorino | 2011-07-06 | 1 | -1/+1 |
|\ \ | | | | | | | collection_singular_ids ignores association :include option | ||||
| * | | 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. | ||||
* | | | Don't construct association scope in initializer. This yields a big ↵ | Jon Leighton | 2011-07-07 | 1 | -6/+10 |
|/ / | | | | | | | performance gain for cases where the association is never used to load the target, for example with preloading. Related: #1873. | ||||
* | | Merge pull request #1968 from bogdan/associations_find_array_compatibility2 | Santiago Pastorino | 2011-07-05 | 1 | -3/+7 |
|\ \ | |/ |/| | Fixed CollectionAssociation#find to be compatible with Array#find | ||||
| * | 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. | ||||
* | | Only call set_owner_attributes for has_one association if target exists. | Dieter Komendera | 2011-07-04 | 1 | -1/+1 |
|/ | |||||
* | a few minor performance improvements: fewer strings, fewer range objects, ↵ | Aaron Patterson | 2011-07-01 | 2 | -22/+13 |
| | | | | fewer method calls | ||||
* | remove unused codes | Aaron Patterson | 2011-07-01 | 1 | -4/+0 |
| | |||||
* | reduce calls to owners_by_key and to read_attribute, respond_to? etc | Aaron Patterson | 2011-07-01 | 1 | -2/+3 |
| | |||||
* | Assign the association attributes to the associated record before the ↵ | Jon Leighton | 2011-06-30 | 3 | -8/+10 |
| | | | | before_initialize callback of the record runs. Fixes #1842. | ||||
* | match method signature of the superclass | Aaron Patterson | 2011-06-30 | 1 | -3/+3 |
| | |||||
* | cache the plural name on the reflection so we do not pay pluralize costs on ↵ | Aaron Patterson | 2011-06-30 | 1 | -1/+1 |
| | | | | joins | ||||
* | 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. | ||||
* | remove warning: assigned but unused variable | Santiago Pastorino | 2011-06-08 | 1 | -1/+1 |
| | |||||
* | Allow polymorphic has_one to work when the association is set before the ↵ | Jon Leighton | 2011-06-08 | 1 | -3/+1 |
| | | | | owner has been saved. Fixes #1524. | ||||
* | When you add a record to a polymorphic has_one, you should be able to access ↵ | Jon Leighton | 2011-06-08 | 2 | -2/+2 |
| | | | | the owner from the associated record | ||||
* | Don't double assign attributes - closes #1467. | Andrew White | 2011-06-03 | 1 | -1/+0 |
| | |||||
* | added an alias for new to build to the AR collection proxy, this corrects an ↵ | Josh Kalderimis | 2011-06-01 | 2 | -10/+2 |
| | | | | issue where the collection proxies were not consistent | ||||
* | Only save the record once when calling create! on a collection association. ↵ | Jon Leighton | 2011-05-31 | 4 | -25/+45 |
| | | | | Fixes #1360. |