robworley/hstore_translate — pull request #22 by robworley (2013-10-14 13:50:39+00:00)
Title: Find records with specific translations

In response to https://github.com/robworley/hstore_translate/pull/19. To find records using translations without constructing hstore queries by hand:

```ruby
Post.with_title_translation("This database rocks!") # => #
Post.with_title_translation("אתר זה טוב", :he) # => #
```

This approach makes no assumptions about cardinality and should play nicely across all supported ActiveRecord versions. We can call `#first`, `#first!`, `#any?`, `#count` etc. and chain with other relations.