ecm_time_tracking_backend 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f2fc187a605d95522e0a8c6b44f620b05009d00
4
- data.tar.gz: c8da001b27e09ec5717a9923215fae3807e0a35a
3
+ metadata.gz: 928ed1cccc4267d2464a6b8940e1ac4ff6097365
4
+ data.tar.gz: 6f2642b636f7dcdd252cc68917a1c5fa6a5d502d
5
5
  SHA512:
6
- metadata.gz: 70ebcf79ed98e9bfb0bbd1e755a67fd7e2f84887345ff3728c63ebf893ba6e9e7d358f56ebd4ef078f158d8900c36ddc4655d08bea8cb99e0fd39c183dfcb09f
7
- data.tar.gz: 03ea28acd6b4f6262497b15e5ff9506f910cdda7459248da1518e88496125f31000df23b18da096d45360ddde988332965b548e53fa28ae481b7f107bc6a8f2c
6
+ metadata.gz: 77a35dc0f03363a97ba7680448e7133080d40b1517689ecb288c3e14b0c813eda28076a04bd998810c13b980c902cfe64c18c4a0c80824a37131d64e6cd88307
7
+ data.tar.gz: c1a78319849c98fa7cb45e920e1a014f04e531ff2772a0693a2d83b2fbd3a2f9bc1b2292b53355eed297b4e34bf3d1309c038dde89e1c4ffd0c018a7429266c7
@@ -8,6 +8,19 @@ module Ecm
8
8
 
9
9
  private
10
10
 
11
+ def current_tracker_id
12
+ proc = Configuration.current_tracker_id_proc
13
+ instance_exec &proc
14
+ end
15
+
16
+ def load_scope
17
+ resource_class.where(tracker_id: current_tracker_id)
18
+ end
19
+
20
+ def collection_scope
21
+ resource_class.where(tracker_id: current_tracker_id)
22
+ end
23
+
11
24
  def permitted_params
12
25
  p = params.dup; p[:entry][:tracker_id] = current_user.id
13
26
  p.require(:entry).permit(:begin_at, :end_at, :tracker_id, :break_length_in_minutes, :entry_type_id)
@@ -1,9 +1,9 @@
1
1
  .panel.panel-default
2
2
  .panel-heading
3
3
  .panel-title
4
- %h3= Ecm::TimeTracking::SumsService.model_name.human
4
+ %h3= Ecm::TimeTracking::SoftwareDeveloperSumsService.model_name.human
5
5
  .table
6
- - sums = Ecm::TimeTracking::SumsService.call(entries: entries)
6
+ - sums = Ecm::TimeTracking::SoftwareDeveloperSumsService.call(entries: entries)
7
7
  - if sums.success?
8
8
  = render_resource(sums, as: :bootstrap_attribute_table) do |table|
9
9
  = table.row :overtime do |resource|
@@ -16,6 +16,10 @@ module Ecm
16
16
  mattr_accessor :registered_services do
17
17
  -> { [] }
18
18
  end
19
+
20
+ mattr_accessor :current_tracker_id_proc do
21
+ ->(controller) { controller.current_user.try(:id) }
22
+ end
19
23
  end
20
24
  end
21
25
  end
@@ -1,7 +1,7 @@
1
1
  module Ecm
2
2
  module TimeTracking
3
3
  module Backend
4
- VERSION = '0.0.5'.freeze
4
+ VERSION = '0.0.6'.freeze
5
5
  end
6
6
  end
7
7
  end
@@ -22,4 +22,10 @@ Ecm::TimeTracking::Backend.configure do |config|
22
22
  [
23
23
  ]
24
24
  }
25
+
26
+ # Proc that will be used to retrieve the current tracker id.
27
+ #
28
+ # Default: config.current_tracker_id_proc = ->(controller) { controller.current_user.try(:id) }
29
+ #
30
+ config.current_tracker_id_proc = ->(controller) { controller.current_user.try(:id) }
25
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm_time_tracking_backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-07 00:00:00.000000000 Z
11
+ date: 2016-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails