from Hacker News

Show HN: A gem to stop progressively building ActiveRecord queries

by 5vforest on 11/17/13, 6:59 PM with 8 comments

  • by mikkelewis on 11/17/13, 7:23 PM

    While I think this is a good idea for smaller data sets, it just isn't feasible for larger data sets that require indices. Having every combination of columns as indices is just hell for the RDBMS. When you are faceting with a large dataset, it's better to use something like ElasticSearch or Sphinx.
  • by troels on 11/17/13, 7:49 PM

    Nice. I've built something very similar in my current app. In my app it's called `SearchModel` and descendants live within the `app/models` dir. I include some modules from `ActiveModel` to make it act as a regular db-backed model, which allows me to use it with `form_for`.
  • by octernion on 11/17/13, 8:08 PM

  • by seivan on 11/17/13, 9:12 PM

    It's basically a service object specifically built for scopes with its own DSL. I like it :)

    Correct me if I am wrong.