diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/stif/my_workbench_scopes.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/stif/my_workbench_scopes.rb b/lib/stif/my_workbench_scopes.rb index ed3432ad3..7e4500a7d 100644 --- a/lib/stif/my_workbench_scopes.rb +++ b/lib/stif/my_workbench_scopes.rb @@ -1,20 +1,19 @@ class Stif::MyWorkbenchScopes - attr_accessor :organisation + attr_accessor :workbench def initialize(workbench) @workbench = workbench end - def line_scope - scope = Chouette::Line - ids = self.parse_functional_scope - ids ? scope.where(objectid: ids) : scope.all + def line_scope(initial_scope) + ids = self.parse_functional_scope + ids ? initial_scope.where(objectid: ids) : initial_scope end def parse_functional_scope return false unless @workbench.organisation.sso_attributes begin - line_ids = JSON.parse @workbench.organisation.sso_attributes['functional_scope'] + JSON.parse @workbench.organisation.sso_attributes['functional_scope'] rescue Exception => e Rails.logger.error "MyWorkbenchScopes : #{e}" end |
