Skip to content

Instantly share code, notes, and snippets.

@collin
Created March 5, 2009 12:55
Show Gist options
  • Select an option

  • Save collin/74345 to your computer and use it in GitHub Desktop.

Select an option

Save collin/74345 to your computer and use it in GitHub Desktop.
class Subject
include DataMapper::Resource
has n, :subject_tweets,
:order => [:tweet_id.desc],
:limit => 15
# has n, :tweets, :through => Resource,
# :order => [:tweet_id.asc]
def tweets(params={})
Tweet.get subject_tweets(params).map{|subject_tweet| subject_tweet.tweet_id }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment