lib/avo/base_resource.rb in avo-0.5.0.beta6 vs lib/avo/base_resource.rb in avo-0.5.0.beta7
- old
+ new
@@ -9,10 +9,11 @@
class_attribute :id, default: :id
class_attribute :title, default: :id
class_attribute :search, default: [:id]
class_attribute :includes, default: []
+ class_attribute :model_class
class_attribute :translation_key
class_attribute :default_view_type, default: :table
class_attribute :devise_password_optional, default: false
class_attribute :fields_loader
class_attribute :actions_loader
@@ -156,9 +157,11 @@
panels
end
def model_class
+ return self.class.model_class if self.class.model_class.present?
+
return @model.class if @model.present?
self.class.name.demodulize.chomp('Resource').safe_constantize
end