diff options
| author | vlatka pavisic | 2016-11-09 15:10:29 +0100 |
|---|---|---|
| committer | vlatka pavisic | 2016-11-09 15:10:29 +0100 |
| commit | 21c6807d2167ffdbcaed58844d1ebafb06c22d6e (patch) | |
| tree | d4f0bca5b97266f08a956de2b946a1bf79a3e964 /lib | |
| parent | 56c0f55d2d8d566b931664b85c76dbe3a58e31cc (diff) | |
| parent | 0dbc80d54b1362c9eb0fc87d8d93f3d60ade68e1 (diff) | |
| download | chouette-core-21c6807d2167ffdbcaed58844d1ebafb06c22d6e.tar.bz2 | |
Refs #1872 : Fix conflicts
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/stif/my_workbench_scopes.rb | 23 | ||||
| -rw-r--r-- | lib/tasks/ci.rake | 1 |
2 files changed, 24 insertions, 0 deletions
diff --git a/lib/stif/my_workbench_scopes.rb b/lib/stif/my_workbench_scopes.rb new file mode 100644 index 000000000..89c4e659c --- /dev/null +++ b/lib/stif/my_workbench_scopes.rb @@ -0,0 +1,23 @@ +module Stif + class MyWorkbenchScopes + attr_accessor :workbench + + def initialize(workbench) + @workbench = workbench + end + + 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 + JSON.parse @workbench.organisation.sso_attributes['functional_scope'] + rescue Exception => e + Rails.logger.error "MyWorkbenchScopes : #{e}" + end + end + end +end diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake index 7fca878b6..2b584c08b 100644 --- a/lib/tasks/ci.rake +++ b/lib/tasks/ci.rake @@ -3,6 +3,7 @@ namespace :ci do task :setup do cp "config/database/jenkins.yml", "config/database.yml" sh "RAILS_ENV=test rake db:migrate" + sh "npm install" end def git_branch |
