Sha256: 4158e54df19542b4d392ebc4e41243e49a992bfad39045a614b4f03222b4e465
Contents?: true
Size: 576 Bytes
Versions: 14
Compression:
Stored size: 576 Bytes
Contents
class SimpleContentManagement::SimplePagesConstraint def initialize @routes = SimpleContentManagement::SimpleRoute.all end def route_created_or_updated(route) if !(existing_route = @routes.find{ |existing_route| existing_route.id == route.id }).nil? existing_route.reload else @routes << route end end def matches?(request) path = request.params[:path].chomp ".html" !@routes.find{ |route| route.path == path }.nil? end def self.instance @@instance ||= SimpleContentManagement::SimplePagesConstraint.send :new end private_class_method :new end
Version data entries
14 entries across 14 versions & 1 rubygems