Module: Effective::Resources::Klass

Included in:
Effective::Resource
Defined in:
app/models/effective/resources/klass.rb

Instance Method Summary collapse

Instance Method Details

#active_model?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'app/models/effective/resources/klass.rb', line 23

def active_model?
  klass && klass.ancestors.include?(ActiveModel::Model)
end

#active_record?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'app/models/effective/resources/klass.rb', line 19

def active_record?
  klass && klass.ancestors.include?(ActiveRecord::Base)
end

#controller_klassObject



15
16
17
# File 'app/models/effective/resources/klass.rb', line 15

def controller_klass
  find_controller_klass
end

#datatable_klassObject



11
12
13
# File 'app/models/effective/resources/klass.rb', line 11

def datatable_klass
  (find_tenant_datatable_klass || find_datatable_klass) if defined?(EffectiveDatatables)
end

#klassObject



7
8
9
# File 'app/models/effective/resources/klass.rb', line 7

def klass
  @model_klass
end