Skip to content

Instantly share code, notes, and snippets.

@aphyr
Created August 27, 2009 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aphyr/176449 to your computer and use it in GitHub Desktop.
Save aphyr/176449 to your computer and use it in GitHub Desktop.
class API::Comment < Sequel::Model(:group_audits)
# Comments, as we're interested in them, are review_videos and add_videos.
reviews = API::Comment.filter(:group_audits__action => 'review_video')
adds = API::Comment.filter(
{:group_audits__action => 'add_video'} &
(:length.sql_function(:group_audits__text) > 0)
)
set_dataset reviews.union(adds).opts[:from].first.expression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment