her
her copied to clipboard
Support for association extensions
Sorry for all the posts but I'm loving Her and just want to see it keep getting better.
I checked all the Issues and don't see this. Is there support for association extensions? For example:
class User
has_many :addresses do
def count
# custom get that doesn't return all the records first and then add the array
end
end
end
so @user.addresses.count would use the defined count instead of doing what it appears now, which is:
- Hit the User endpoint
- If response includes addresses, return those, if not, hit the addresses endpoint
- return the count of the array
Unfortunately no, but that would be a really cool feature that we'd love to see 😻There's a more fundamental problem with scopes on associations that will probably need to be resolved first.