class Refinery::Pages::FinderByPathOrId

Attributes

id[RW]
path[RW]

Public Class Methods

new(path, id) click to toggle source
# File lib/refinery/pages/finder.rb, line 158
def initialize(path, id)
  @path = path
  @id = id
end

Public Instance Methods

find() click to toggle source
# File lib/refinery/pages/finder.rb, line 163
def find
  if path.present?
    if path.friendly_id?
      FinderByPath.new(path).find
    else
      Page.friendly.find(path)
    end
  elsif id.present?
    Page.friendly.find(id)
  end
end