Ransack

https://github.com/activerecord-hackery/ransack

Seems like a promising for your usecase. Take a look at it.

On Mon, Jul 13, 2015 at 5:40 AM, j...@via.net <j...@via.net> wrote:

> class Asset < ActiveRecord::Base
>   belongs_to :site
>
>   # class variable :name
>
> end
>
> class Site < ActiveRecord::Base
>   has_many :assets
>
>   # class var x, y, z
>
> end
>
> Is there a dynamic finder that will traverse the inner join:
>
> e.g. Site.find_by_asset_name("xyzzy")
>
> Can I get a list of sites where asset.name == "BAZ"
>
> Can this be done in AR or do I have to resort to SQL?
>
> Thanks,
>
> Joe
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-talk+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/7f72701d-cd1c-4219-b4e3-1aa5b643a895%40googlegroups.com
> <https://groups.google.com/d/msgid/rubyonrails-talk/7f72701d-cd1c-4219-b4e3-1aa5b643a895%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Regards
Vineeth B S

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAAk7vin%2BKX-eC%2BJe1R4sDPv1mwuqX0motp%3DFB0HyJcJBye0xuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to