Created
June 3, 2010 10:31
-
-
Save bulters/423721 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
named_scope :magic, lambda { | |
{ | |
:joins => "INNER JOIN airings ON airings.id=spotlights.object_id INNER JOIN episodes ON episodes.id=airings.episode_id", | |
:conditions => ["object_type='Airing' AND airings.ends_at < ? AND episodes.video IS NOT NULL", DateTime.now.utc], | |
:order => "airings.ends_at DESC", | |
:group => "airings.id" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment