Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Commit

Permalink
Show better error with Site.current not set
Browse files Browse the repository at this point in the history
  • Loading branch information
seven1m committed Feb 18, 2017
1 parent 235f186 commit c759764
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/db_tools.rb
@@ -1,6 +1,6 @@
class ActiveRecord::Base
def self.scope_by_site_id
default_scope -> { where(site_id: Site.current.id) }
default_scope -> { Site.current ? where(site_id: Site.current.id) : raise('Site.current is nil') }
end

def self.digits_only_for_attributes=(attributes)
Expand Down

0 comments on commit c759764

Please sign in to comment.