Class: ActiveRecord::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/delete_softly.rb

Overview

Overwrite ActiveRecord::Base#default_scope

Class Method Summary collapse

Class Method Details

.default_scope(options = {}) ⇒ Object



79
80
81
82
83
# File 'lib/delete_softly.rb', line 79

def self.default_scope(options = {})
  key = :"#{self}_scoped_methods"
  Thread.current[key] = nil
  self.default_scoping << construct_finder_arel(options, default_scoping.pop)    
end