added enabling and disabling feature of widget count in module init
This commit is contained in:
1 parent
2a41e90bc1
commit
800f108be3
5 files changed
+17
-4
No files matched your search
@@ -28,7 +28,7 @@ module OrbitApp
|
||||
end
|
||||
|
||||
class DataSheet
|
||||
attr_reader :name,:key,:base_path,:module_label,:data_count, :has_category, :has_tag, :approvable_models, :authorizable_models, :is_approvable, :is_authorizable
|
||||
attr_reader :name,:key,:base_path,:module_label,:data_count, :has_category, :has_tag, :approvable_models, :authorizable_models, :is_approvable, :is_authorizable, :enable_widget_data_count
|
||||
|
||||
def initialize(name, &block)
|
||||
@name = name
|
||||
@@ -43,6 +43,7 @@ module OrbitApp
|
||||
@authorizable_models = []
|
||||
@is_approvable = nil
|
||||
@is_authorizable = nil
|
||||
@enable_widget_data_count = true
|
||||
block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given?
|
||||
setup_module_app
|
||||
end
|
||||
@@ -63,6 +64,10 @@ module OrbitApp
|
||||
|
||||
end
|
||||
|
||||
def get_enable_widget_data_count
|
||||
@enable_widget_data_count
|
||||
end
|
||||
|
||||
def get_label_i18n
|
||||
@module_label
|
||||
end
|
||||
@@ -164,6 +169,10 @@ module OrbitApp
|
||||
end
|
||||
end
|
||||
|
||||
def enable_widget_data_count(enable = true)
|
||||
@enable_widget_data_count = enable
|
||||
end
|
||||
|
||||
def approvable_on(klass = 'Category')
|
||||
@approvable_models << klass
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user