Skip to content

Instantly share code, notes, and snippets.

@cyx
Created October 1, 2010 18:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cyx/606610 to your computer and use it in GitHub Desktop.
Save cyx/606610 to your computer and use it in GitHub Desktop.
class Comment < Ohm::Model
end
class Post < Ohm::Model
list :comments, Comment
end
post = Post.create
10.times { post.comments.push(Comment.create) }
# Getting the first 3 comments could only be done using:
Ohm.redis.lrange post.comments.key, 0, 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment