Sha256: 07812347f18ecd3ae55cf1e1d0520b54c913c9081f5bc44171c0a41d3f9f0a11

Contents?: true

Size: 355 Bytes

Versions: 3

Compression:

Stored size: 355 Bytes

Contents

class Cas::Sites::ApplicationController < ::Cas::ApplicationController
  before_action :set_site

  private

  def set_site
    if params[:site_id].present?
      @site = ::Cas::Site.find_by!(slug: params[:site_id])
    else
      @site = ::Cas::Site
        .where("cas_sites.domains::text[] && '{#{@domain}}'::text[]")
        .first!
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cas-cms-0.1.3 app/controllers/cas/sites/application_controller.rb
cas-cms-0.1.2 app/controllers/cas/sites/application_controller.rb
cas-cms-0.1.1 app/controllers/cas/sites/application_controller.rb