Class: Refinery::Pages::FinderBySlug

Inherits:
Finder
  • Object
show all
Defined in:
pages/lib/refinery/pages/finder.rb

Instance Method Summary collapse

Methods inherited from Finder

by_path, by_path_or_id, by_slug, by_title, #find, with_globalize, #with_globalize

Constructor Details

#initialize(slug, conditions) ⇒ FinderBySlug

Returns a new instance of FinderBySlug



77
78
79
80
# File 'pages/lib/refinery/pages/finder.rb', line 77

def initialize(slug, conditions)
  @slug = slug
  @conditions = default_conditions.merge(conditions)
end

Instance Method Details

#default_conditionsObject



82
83
84
85
86
87
# File 'pages/lib/refinery/pages/finder.rb', line 82

def default_conditions
  {
    :locale => Refinery::I18n.frontend_locales.map(&:to_s),
    :slug => slug
  }
end