Ohm-find_by is a project mainly written in Ruby, based on the View license.
find_by to Ohm::Model
This is just a fast implementation of AR findby{attr} for Ohm
class Post < Ohm::Model
attribute :name
attribute :author
index :name
end
With that Ohm::Model in mind now you can do this:
Post.create :name => "My first Post", :author => "elCuervo"
=> #<Post:1 name="My first Post" author="elCuervo">
Post.find_by_name "My first Post"
=> #<Set (Post): ["1"]>
Also checks the existence of the index before searching so:
Post.find_by_author "elCuervo"
=> Ohm::Model::IndexNotFound