Class | Her::Model::Associations::Association |
In: |
lib/her/model/associations/association.rb
|
Parent: | Object |
params | [RW] | @private |
Fetches the data specified by id
@example
class User include Her::Model has_many :comments end user = User.find(1) user.comments.find(3) # Fetched via GET "/users/1/comments/3
Refetches the association and puts the proxy back in its initial state, which is unloaded. Cached associations are cleared.
@example
class User include Her::Model has_many :comments end class Comment include Her::Model end user = User.find(1) user.comments = [#<Comment(comments/2) id=2 body="Hello!">] user.comments.first.id = "Oops" user.comments.reload # => [#<Comment(comments/2) id=2 body="Hello!">] # Fetched again via GET "/users/1/comments"