Create a gist now

Instantly share code, notes, and snippets.

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