her icon indicating copy to clipboard operation
her copied to clipboard

Support for association extensions

Open noctivityinc opened this issue 6 years ago • 1 comments

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

noctivityinc avatar Feb 13 '19 16:02 noctivityinc

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.

zacharywelch avatar Feb 13 '19 23:02 zacharywelch