Class: ActiveRecord::Associations::Association

Inherits:
Object
  • Object
show all
Defined in:
lib/activerecord-multi-tenant/model_extensions.rb

Instance Method Summary collapse

Instance Method Details

#skip_statement_cache?(*scope) ⇒ Boolean

Returns:

  • (Boolean)


153
154
155
156
157
158
159
160
161
162
# File 'lib/activerecord-multi-tenant/model_extensions.rb', line 153

def skip_statement_cache?(*scope)
  return true if klass.respond_to?(:scoped_by_tenant?) && klass.scoped_by_tenant?

  if reflection.through_reflection
    through_klass = reflection.through_reflection.klass
    return true if through_klass.respond_to?(:scoped_by_tenant?) && through_klass.scoped_by_tenant?
  end

  skip_statement_cache_orig(*scope)
end

#skip_statement_cache_origObject



152
# File 'lib/activerecord-multi-tenant/model_extensions.rb', line 152

alias skip_statement_cache_orig skip_statement_cache?