Commit 86dba883 by liyijie

feat: 同时支持工作流的导入和导出class

parent 9da08e62
......@@ -117,8 +117,15 @@ class SimpleController::BaseController < ::InheritedResources::Base
self.class_attribute :importable_class, instance_writer: false unless self.respond_to? :importable_class
self.class_attribute :exportable_class, instance_writer: false unless self.respond_to? :exportable_class
self.importable_class = options.delete(:importable_class) || self.name.sub(/Controller$/, 'Excel').safe_constantize || self.resource_class
self.exportable_class = options.delete(:exportable_class) || self.name.sub(/Controller$/, 'Excel').safe_constantize || self.resource_class
self.importable_class =
options.delete(:importable_class) ||
(self.name.sub(/Controller$/, 'Excel::Import').safe_constantize && self.name.sub(/Controller$/, 'Excel').safe_constantize) ||
self.resource_class
self.exportable_class =
options.delete(:exportable_class) ||
(self.name.sub(/Controller$/, 'Excel::Export').safe_constantize && self.name.sub(/Controller$/, 'Excel').safe_constantize) ||
self.resource_class
set_view_path view_path if view_path.present?
super(options)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment