Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | Nullify the relation at a more general level. | Jon Leighton | 2012-11-09 | 1 | -4/+3 | |
| | | | | | | | | | | | | | | | This allows us to avoid hacks like the "return 0 if owner.new_record?" in #count (which this commit removes). Also, the relevant foreign key may actually be present even on a new owner record, in which case we *don't* want a null relation. This logic is encapsulated in the #null_scope? method. We also need to make sure that the CollectionProxy is not 'infected' with the NullRelation module, or else the methods from there will override the definitions in CollectionProxy, leading to incorrect results. Hence the nullify: false option to CollectionAssociation#scope. (This feels a bit nasty but I can't think of a better way.) | |||||
* | Relations built off collection associations with an unsaved owner should be ↵ | Jon Leighton | 2012-11-09 | 1 | -2/+3 | |
| | | | | | | | | | | null relations For example, the following should not run any query on the database: Post.new.comments.where(body: 'omg').to_a # => [] Fixes #5215. | |||||
* | fix AR::Associations::CollectionProxy#delete broken documentation [ci skip] | Francesco Rodriguez | 2012-09-21 | 1 | -23/+2 | |
| | ||||||
* | update AR::Associations::CollectionProxy#loaded? documentation [ci skip] | Francesco Rodriguez | 2012-09-21 | 1 | -1/+6 | |
| | ||||||
* | Remove mass_assignment_options from ActiveRecord | Guillermo Iguaran | 2012-09-16 | 1 | -6/+6 | |
| | ||||||
* | Remove mass assignment security from ActiveRecord | Guillermo Iguaran | 2012-09-16 | 1 | -1/+0 | |
| | ||||||
* | Update documentation for CollectionProxy | Marc-Andre Lafortune | 2012-09-12 | 1 | -8/+2 | |
| | ||||||
* | s/scoped/scope/ | Jon Leighton | 2012-08-01 | 1 | -3/+3 | |
| | ||||||
* | Add CollectionProxy#scope | Jon Leighton | 2012-08-01 | 1 | -1/+5 | |
| | | | | | | | | | | | | | | | | This can be used to get a Relation from an association. Previously we had a #scoped method, but we're deprecating that for AR::Base, so it doesn't make sense to have it here. This was requested by DHH, to facilitate code like this: Project.scope.order('created_at DESC').page(current_page).tagged_with(@tag).limit(5).scoping do @topics = @project.topics.scope @todolists = @project.todolists.scope @attachments = @project.attachments.scope @documents = @project.documents.scope end | |||||
* | Use explicit delegations | Jon Leighton | 2012-08-01 | 1 | -119/+79 | |
| | | | | | | | This makes it easier to see what the documentation refers to. It also means that we are not doing unnecessary work for delegations that have no args / splats / block / etc. | |||||
* | fix typo in collection proxy | Accessd | 2012-07-31 | 1 | -1/+1 | |
| | ||||||
* | Deprecate ActiveRecord::Base.scoped. | Jon Leighton | 2012-07-27 | 1 | -5/+1 | |
| | | | | | | | It doesn't serve much purpose now that ActiveRecord::Base.all returns a Relation. The code is moved to active_record_deprecated_finders. | |||||
* | Merge branch 'master' of github.com:lifo/docrails | Vijay Dev | 2012-05-30 | 1 | -1/+1 | |
|\ | ||||||
| * | change example on CollectionProxy#delete to accept multiple values | Francesco Rodriguez | 2012-05-28 | 1 | -1/+1 | |
| | | ||||||
* | | Add support for CollectionAssociation#delete by Fixnum or String | Francesco Rodriguez | 2012-05-28 | 1 | -0/+26 | |
|/ | | | | | | | | | | | | | | | | | | | | | | | | 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. | |||||
* | add CollectionProxy#uniq documentation | Francesco Rodriguez | 2012-05-26 | 1 | -0/+21 | |
| | ||||||
* | add :nodoc: to CollectionProxy#initialize | Francesco Rodriguez | 2012-05-25 | 1 | -1/+1 | |
| | ||||||
* | add CollectionProxy#== documentation | Francesco Rodriguez | 2012-05-25 | 1 | -0/+24 | |
| | ||||||
* | add CollectionProxy#count documentation | Francesco Rodriguez | 2012-05-25 | 1 | -0/+26 | |
| | ||||||
* | add CollectionProxy#to_ary documentation | Francesco Rodriguez | 2012-05-25 | 1 | -2/+35 | |
| | ||||||
* | add CollectionProxy#delete documentation | Francesco Rodriguez | 2012-05-25 | 1 | -1/+104 | |
| | ||||||
* | copy edits in collection proxy docs [ci skip] | Vijay Dev | 2012-05-23 | 1 | -25/+18 | |
| | ||||||
* | add CollectionProxy#length documentation | Francesco Rodriguez | 2012-05-22 | 1 | -5/+37 | |
| | ||||||
* | add CollectionProxy#size documentation | Francesco Rodriguez | 2012-05-22 | 1 | -2/+25 | |
| | ||||||
* | add :call-seq: to +first+ and +last+ CollectionProxy methods | Francesco Rodriguez | 2012-05-22 | 1 | -0/+6 | |
| | ||||||
* | add CollectionProxy#create! documentation | Francesco Rodriguez | 2012-05-22 | 1 | -0/+22 | |
| | ||||||
* | add CollectionProxy#create documentation | Francesco Rodriguez | 2012-05-22 | 1 | -0/+33 | |
| | ||||||
* | add more examples to CollectionProxy#find | Francesco Rodriguez | 2012-05-22 | 1 | -0/+9 | |
| | ||||||
* | adding :call-seq: to CollectionProxy methods | Francesco Rodriguez | 2012-05-22 | 1 | -0/+39 | |
| | ||||||
* | add CollectionProxy#build documentation | Francesco Rodriguez | 2012-05-22 | 1 | -0/+31 | |
| | ||||||
* | remove repeated documentation in CollectionProxy#clear | Francesco Rodriguez | 2012-05-22 | 1 | -24/+2 | |
| | ||||||
* | update CollectionProxy#clear documentation | Francesco Rodriguez | 2012-05-21 | 1 | -3/+2 | |
| | ||||||
* | update CollectionProxy#delete_all documentation | Francesco Rodriguez | 2012-05-21 | 1 | -2/+29 | |
| | ||||||
* | add CollectionProxy#delete_all documentation | Francesco Rodriguez | 2012-05-21 | 1 | -0/+65 | |
| | ||||||
* | fix CollectionProxy documentation markup | Francesco Rodriguez | 2012-05-21 | 1 | -8/+8 | |
| | ||||||
* | add CollectionProxy#reload documentation | Francesco Rodriguez | 2012-05-21 | 1 | -0/+18 | |
| | ||||||
* | improve CollectionProxy#destroy documentation | Francesco Rodriguez | 2012-05-21 | 1 | -5/+37 | |
| | ||||||
* | add CollectionProxy#destroy documentation | Francesco Rodriguez | 2012-05-21 | 1 | -1/+42 | |
| | ||||||
* | update CollectionProxy#destroy_all documentation | Francesco Rodriguez | 2012-05-20 | 1 | -1/+9 | |
| | ||||||
* | add CollectionProxy#select documentation | Francesco Rodriguez | 2012-05-19 | 1 | -2/+55 | |
| | ||||||
* | add CollectionProxy#find documentation | Francesco Rodriguez | 2012-05-19 | 1 | -0/+20 | |
| | ||||||
* | copy edits [ci skip] | Vijay Dev | 2012-05-19 | 1 | -17/+20 | |
| | ||||||
* | add CollectionProxy#last documentation | Francesco Rodriguez | 2012-05-19 | 1 | -0/+27 | |
| | ||||||
* | add CollectionProxy#first documentation | Francesco Rodriguez | 2012-05-19 | 1 | -0/+27 | |
| | ||||||
* | improve CollectionProxy#concat documentation | Francesco Rodriguez | 2012-05-19 | 1 | -7/+18 | |
| | ||||||
* | fix CollectionProxy#<< documentation | Francesco Rodriguez | 2012-05-19 | 1 | -1/+1 | |
| | ||||||
* | add CollectionProxy#<< documentation | Francesco Rodriguez | 2012-05-19 | 1 | -0/+20 | |
| | ||||||
* | add CollectionProxy#clear documentation | Francesco Rodriguez | 2012-05-19 | 1 | -0/+26 | |
| | ||||||
* | add CollectionProxy#include? documentation | Francesco Rodriguez | 2012-05-18 | 1 | -0/+13 | |
| | ||||||
* | move docs from CollectionAssociation to CollectionProxy | Francesco Rodriguez | 2012-05-18 | 1 | -1/+142 | |
| |