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

Configuration flag to make uri: nil option on associations the default #85

Open
samandmoore opened this issue Jun 19, 2017 · 1 comment

Comments

@samandmoore
Copy link
Contributor

Hi there,

I'm curious if you'd be open to a PR introducing a configuration option to make the uri: nil option on associations the default. I much prefer the uri: nil behavior because I've found that in production I rarely, if ever, want to perform the subsequent fetch. Having a library-level configuration option would provide a better default for my usages.

As always, thanks for this library and your time!

@balvig
Copy link
Owner

balvig commented Jun 19, 2017

@samandmoore thanks! Aha yes I can imagine how not making the extra fetch would be common in many projects... 🤔

The only thing I'm not sure of how this would work with the default, which is

class User < Spyke::Base
  has_many :posts
end

class Post < Spyke::Base
end

User.find(1).posts #=> default: /users/1/posts

if the default of uri is nil, then I guess it means you have to specify this manually whenever you do want it hmm 🤔

(will think about it some more, but feel free to submit any thoughts!)

@samandmoore samandmoore changed the title Configuration flag to make uri: nil open on associations the default Configuration flag to make uri: nil option on associations the default Jun 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants