Sha256: 4c3179cf24525729b18a06a98ee6a35706054cf12b87d279c85e5efec4d72279
Contents?: true
Size: 1.23 KB
Versions: 66
Compression:
Stored size: 1.23 KB
Contents
module Effective module Resources module Klass def klass @model_klass end def datatable_klass @datatable_klass ||= if defined?(EffectiveDatatables) "#{namespaced_class_name.pluralize}Datatable".safe_constantize || "#{class_name.pluralize.camelize}Datatable".safe_constantize || "#{name.pluralize.camelize}Datatable".safe_constantize || "Effective::Datatables::#{namespaced_class_name.pluralize}".safe_constantize || "Effective::Datatables::#{class_name.pluralize.camelize}".safe_constantize || "Effective::Datatables::#{name.pluralize.camelize}".safe_constantize end end def controller_klass @controller_klass ||= ( "#{namespaced_class_name.pluralize}Controller".safe_constantize || "#{class_name.pluralize.classify}Controller".safe_constantize || "#{name.pluralize.classify}Controller".safe_constantize || "#{initialized_name.to_s.classify.pluralize}Controller".safe_constantize || "#{initialized_name.to_s.classify}Controller".safe_constantize ) end def active_record? klass.ancestors.include?(ActiveRecord::Base) end end end end
Version data entries
66 entries across 66 versions & 1 rubygems