justinweiss / reactive_resource

ActiveRecord-style associations and miscellaneous fixes for nested ActiveResources
http://rubydoc.info/gems/reactive_resource/frames
MIT License
53 stars 14 forks source link

Can't figure out how to add default query_options #5

Open bartbunting opened 12 years ago

bartbunting commented 12 years ago

Hi, I am using reactive_resource and it is working well for me.

I am trying to understand how I can specify default query params in the has_many relation. In this instance there is a limit which is the number of results returned by the redmine rest API.

Is this something that is possible and I am missing it or is there another obvious work around I am missing?

Any advice would be appreciated. Kind regards Bart

justinweiss commented 12 years ago

Hm, I don't think so. It's a great idea for a patch, though, I bet it'd be really useful. If you're interested, https://github.com/justinweiss/reactive_resource/blob/master/lib/reactive_resource/association/has_many_association.rb#L28 would be the best place to look.

At some point, I was actually thinking about seeing how hard it would be to have reactive resource piggyback on more built-in activemodel stuff -- this repo predates rails 3, and there's probably a ton of good stuff to borrow from it.