Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for association extensions #522

Open
noctivityinc opened this issue Feb 13, 2019 · 1 comment
Open

Support for association extensions #522

noctivityinc opened this issue Feb 13, 2019 · 1 comment

Comments

@noctivityinc
Copy link

noctivityinc commented Feb 13, 2019

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:

  1. Hit the User endpoint
  2. If response includes addresses, return those, if not, hit the addresses endpoint
  3. return the count of the array
@zacharywelch
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants