Last active
August 29, 2015 14:04
-
-
Save rossnelson/217dcbd71bfa66f16dad to your computer and use it in GitHub Desktop.
How would you make this better?
This file contains hidden or 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
| module Dust | |
| class Sitemap | |
| def self.items | |
| menus.includes(:menu_items).map { |menu| menu.menu_items }.flatten | |
| end | |
| def self.names | |
| Dust.config.menus_on_sitemap.join("|") | |
| end | |
| def self.menus | |
| titles.where('title REGEXP ?', names) | |
| end | |
| def self.titles | |
| Dust::Menu.select('title, id') | |
| end | |
| end | |
| end |
jmejia
commented
Jul 23, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment