Skip to content

Instantly share code, notes, and snippets.

@the-teacher
Created December 18, 2015 09:32
Show Gist options
  • Save the-teacher/21b4cf6e1f4587fddc7d to your computer and use it in GitHub Desktop.
Save the-teacher/21b4cf6e1f4587fddc7d to your computer and use it in GitHub Desktop.
RSS FEEDS
    scope :for_yandex_news, -> {
      published.
      recent(:created_at).
      where(yandex_news: true).
      where("published_at >= ?", 8.days.ago.utc)
    }

    scope :for_flipboard_tech, -> {
      published.
      recent(:created_at).
      where(flipboard_tech: true).
      where("published_at >= ?", 14.days.ago.utc)
    }

    scope :for_flipboard_culture, -> {
      published.
      recent(:created_at).
      where(flipboard_culture: true).
      where("published_at >= ?", 14.days.ago.utc)
    }

    scope :for_surfingbird, -> {
      published.
      recent(:created_at).
      where(surfingbird: true).
      where("published_at >= ?", 14.days.ago.utc)
    }

    scope :for_novoteka, -> {
      published.
      recent(:created_at).
      where(novoteka: true).
      where("published_at >= ?", 2.month.ago.utc)
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment