Module: Brightcontent::PageCore::ClassMethods

Defined in:
app/models/brightcontent/page_core.rb

Instance Method Summary collapse

Instance Method Details

#find_by_path(path) ⇒ Object


23
24
25
# File 'app/models/brightcontent/page_core.rb', line 23

def find_by_path(path)
  find_by(slug: sanitize_path(path))
end

#find_by_path!(path) ⇒ Object


27
28
29
# File 'app/models/brightcontent/page_core.rb', line 27

def find_by_path!(path)
  find_by!(slug: sanitize_path(path))
end

#sanitize_path(path) ⇒ Object


31
32
33
# File 'app/models/brightcontent/page_core.rb', line 31

def sanitize_path(path)
  path[1..-1]
end