Class Permalink
In: app/models/permalink.rb
Parent: ActiveRecord::Base

Methods

Public Class methods

[Source]

    # File app/models/permalink.rb, line 7
 7:   def self.is_destination?(check_url,requested_url,rootpath="postings")
 8:      check = check_url.gsub(/\?(.*)$/,"").gsub(/^\//,"")
 9:      rqurl = requested_url.gsub(/\?(.*)$/,"").gsub(/^\//,"")
10:      return true if check == rqurl || rqurl == rootpath
11:      permalink = rqurl.split("/").last
12:      rc = find_by_url(permalink)
13:      return rc && (check.split("/").last == permalink) || (rqurl == '' && check == rootpath)
14:   end

[Validate]