Sha256: 9027f412b789eb3963ebf1dc06489f152b0dff02692d957a75492ed77463e0c8

Contents?: true

Size: 246 Bytes

Versions: 7

Compression:

Stored size: 246 Bytes

Contents

module Storytime::ScopedToSite
  extend ActiveSupport::Concern

  included do
    default_scope do
      if Storytime::Site.current_id.present?
        where(site_id: Storytime::Site.current_id)
      else
        all
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
storytime-2.1.6 app/models/concerns/storytime/scoped_to_site.rb
storytime-2.1.5 app/models/concerns/storytime/scoped_to_site.rb
storytime-2.1.4 app/models/concerns/storytime/scoped_to_site.rb
storytime-2.1.3 app/models/concerns/storytime/scoped_to_site.rb
storytime-2.1.2 app/models/concerns/storytime/scoped_to_site.rb
storytime-2.1.1 app/models/concerns/storytime/scoped_to_site.rb
storytime-2.1.0 app/models/concerns/storytime/scoped_to_site.rb