Class: Pageflow::CnameSiteRequestScope

Inherits:
Object
  • Object
show all
Defined in:
app/models/pageflow/cname_site_request_scope.rb

Instance Method Summary collapse

Instance Method Details

#call(sites, request) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'app/models/pageflow/cname_site_request_scope.rb', line 3

def call(sites, request)
  sites.where(<<-SQL, host: request.host)
    cname = :host OR
    FIND_IN_SET(
      :host,
      REPLACE(additional_cnames, SPACE(1), "")
    )
  SQL
end