Skip to content

Instantly share code, notes, and snippets.

@jeremyevans
Forked from aphyr/gist:176449
Created August 27, 2009 18:15
Show Gist options
  • Save jeremyevans/176457 to your computer and use it in GitHub Desktop.
Save jeremyevans/176457 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, :from_self=>false)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment