ecom_core 1.1.22 → 1.1.27

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
  SHA256:
3
- metadata.gz: 1b94415c80a265d838bd9ea7ce3ea2f7ca1993ffeb10dfe30d29462f5cf10c7d
4
- data.tar.gz: 8d69cd67d8101909bd6c0a62dd10d296746b0e90a03837bce669e6a82098531b
3
+ metadata.gz: 9762a1b0d92bec25c6c0e52c814ee95a2e48e5b271c39d59d28fb8ff4d9b01f2
4
+ data.tar.gz: 0d664422f9ed3f12b49889383b674c3b33090f4d5a0ea9f81c849cb70580b068
5
5
  SHA512:
6
- metadata.gz: 33126ede6c788eb2eff9665b16df30b53d4ce172bb6e2517546237ac81daf52904414732b2a313760686976d48ffe60111394a9fb2b996cbbc32fe1a9fc76377
7
- data.tar.gz: 0c3fa5d8541eeaa4c46234c2a2e4854d1606b0c843e6babcbdcc226f6a7bfa77fc609abba6465a856075abf950917fdd31f7aa2896aed823cb94dbfa289cb6b5
6
+ metadata.gz: 9b88471b8c2196bcfdb57f087a50be078e7e57def36adb2e3a4dbdb9106701374ce7eb503240cee109c9be700b141dc78a3500222c09bb7651cb00fc2d2989eb
7
+ data.tar.gz: bd6e8e1dda621385024a9460a849cb5a6ab198cdc34aa32f03bfe19904216e7bdd76c66a15466b525b7e734dbde94c0a089af110e18be1bc4405e0e0cc49e18d
@@ -7,9 +7,9 @@ module Ecom
7
7
  BOTH = 'Both'.freeze
8
8
 
9
9
  TIME_RANGE = {
10
- MORNING => {start: Time.parse('8:00 AM'), end: Time.parse('12:00 PM')},
11
- AFTERNOON => {start: Time.parse('1:00 PM'), end: Time.parse('5:00 PM')},
12
- BOTH => {start: Time.parse('8:00 AM'), end: Time.parse('5:00 PM')}
10
+ MORNING => {start: Time.zone.parse('5:00 AM'), end: Time.zone.parse('9:00 AM')},
11
+ AFTERNOON => {start: Time.zone.parse('10:00 AM'), end: Time.zone.parse('2:00 PM')},
12
+ BOTH => {start: Time.zone.parse('5:00 AM'), end: Time.zone.parse('2:00 PM')}
13
13
  }.freeze
14
14
 
15
15
  belongs_to :attendance_sheet_entry
@@ -19,10 +19,10 @@ module Ecom
19
19
 
20
20
  validates :hours, presence: true
21
21
 
22
- before_save :calculate_hours
22
+ before_validation :calculate_hours
23
23
 
24
24
  def calculate_hours
25
- self.hours = checkout_time.nil? ? 0 : compute_hours
25
+ self.hours = (checkout_time.nil? || checkin_time.nil?) ? 0 : compute_hours
26
26
  end
27
27
 
28
28
  # A method to check if checkin and checkout range falls in the morning,
@@ -9,13 +9,13 @@ module Ecom
9
9
  SQL
10
10
  menu = Menu.joins(join_sql).where('UR.id IN (?)', role_ids).distinct
11
11
  menu_list = menu.select { |m| m.parent.nil? }.each_with_object([]) do |item, list|
12
- list << { id: item.id, label: item.label, icon: item.icon, children: [] }
12
+ list << { id: item.id, text: item.label, iconCss: item.icon, items: [] }
13
13
  end
14
14
 
15
15
  menu_list.each do |ml|
16
- ml[:children] = menu.reject { |m| m.parent.nil? }.each_with_object([]) do |item, list|
16
+ ml[:items] = menu.reject { |m| m.parent.nil? }.each_with_object([]) do |item, list|
17
17
  if item.parent_id == ml[:id]
18
- list << { id: item.id, label: item.label, icon: item.icon, route: item.route }
18
+ list << { id: item.id, text: item.label, iconCss: item.icon, url: item.route }
19
19
  end
20
20
  end
21
21
  end
@@ -1,5 +1,5 @@
1
1
  module Ecom
2
2
  module Core
3
- VERSION = '1.1.22'.freeze
3
+ VERSION = '1.1.27'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecom_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.22
4
+ version: 1.1.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-15 00:00:00.000000000 Z
11
+ date: 2020-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aasm