1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00

Use alias_method instead of defining an alias method for current_page

This commit is contained in:
Ben Hollis 2014-04-26 12:56:50 -07:00
parent 7108c29035
commit b48a767595

View file

@ -37,18 +37,13 @@ module Middleman
@locs[:current_path]
end
# Get the resource object for the current path
# @return [Middleman::Sitemap::Resource]
def current_page
current_resource
end
# Get the resource object for the current path
# @return [Middleman::Sitemap::Resource]
def current_resource
return nil unless current_path
sitemap.find_resource_by_destination_path(current_path)
end
alias_method :current_page, :current_resource
end
end
end