TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: A gem to stop progressively building ActiveRecord queries

17 pointsby 5vforestover 11 years ago

4 comments

mikkelewisover 11 years ago
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.
评论 #6751280 未加载
troelsover 11 years ago
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`.
评论 #6750698 未加载
octernionover 11 years ago
Differences with <a href="https://github.com/plataformatec/has_scope" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;plataformatec&#x2F;has_scope</a>?
评论 #6750688 未加载
seivanover 11 years ago
It&#x27;s basically a service object specifically built for scopes with its own DSL. I like it :)<p>Correct me if I am wrong.