activerecord-shipworks 0.1.8 → 0.1.9

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: a321ef833e2c013396c31e2828868169fbf46c2a52b0221f9784f06b8abe3c23
4
- data.tar.gz: 2dd4b771c12188fffd8f9a5f4a85df24d16033069f1bfddfb53639ade9e6c16a
3
+ metadata.gz: a67b311a344411c09eb8f3831da4270744b507af043cebb60d29563d0197531e
4
+ data.tar.gz: 06cad043769e48d18eebc5e25756f39ed1b828952f05852588aa89a71a269f3b
5
5
  SHA512:
6
- metadata.gz: da58bfe0801de0a6083020454013304f53be8241329922cfe032567cb0f643ca0795d85d6d95c54bc7256020181635513ce012dbcb4d45ddaf7257bf65d6b082
7
- data.tar.gz: 6f50663a4b1927938fc314401197a49e581a9f4f42196f89c1debfe79d42c2b577d7a598c45aa476845b569110178fe3868ad45cd893ca5859ce274de60328cf
6
+ metadata.gz: 847d7e83b4504068075d1a988a371fef2f78e6325ecff0411e81f5dd6187c98181dd77bde09dbd1698c0f57cc90ec16acfc8a979d8f0a230f1506c069eae9871
7
+ data.tar.gz: 6967bbb8ed45d7f8a1c427a7f47785102aceda6dd19f3bdac6babb3e0b08bbd8282e84c4846ee5260fe1ca9280322542cbcacb7cee5583cec3c8e44a032b6df9
@@ -0,0 +1,27 @@
1
+ module Shipworks
2
+ class Audit < ShipworksRecord
3
+ belongs_to :user, foreign_key: 'UserID'
4
+
5
+ ACTION_MAPPING = {
6
+ 1 => 'Log On',
7
+ 2 => 'Log Off',
8
+ 3 => 'Upgrade Database',
9
+ 4 => 'Backup Database',
10
+ 5 => 'Add',
11
+ 6 => 'Edit',
12
+ 7 => 'Delete',
13
+ 8 => 'Reset ShipSense',
14
+ 9 => 'Reload ShipSense started',
15
+ 10 => 'Combine Order',
16
+ 11 => 'Split Order',
17
+ }
18
+
19
+ ACTION_MAPPING.each do |k, v|
20
+ scope "action_#{v}".parameterize.underscore.to_sym, -> { where(Action: k) }
21
+ end
22
+
23
+ def ActionName
24
+ ACTION_MAPPING[self.Action] || self.Action
25
+ end
26
+ end
27
+ end
@@ -1,5 +1,6 @@
1
1
  module Shipworks
2
2
  class User < ShipworksRecord
3
3
  has_many :notes, foreign_key: 'UserID'
4
+ has_many :audits, foreign_key: 'UserID'
4
5
  end
5
6
  end
@@ -1,3 +1,3 @@
1
1
  module Shipworks
2
- VERSION = '0.1.8'
2
+ VERSION = '0.1.9'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-shipworks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dennis Wu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-25 00:00:00.000000000 Z
11
+ date: 2018-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord-sqlserver-adapter
@@ -36,6 +36,7 @@ files:
36
36
  - Rakefile
37
37
  - app/models/shipworks/amazon_order.rb
38
38
  - app/models/shipworks/amazon_order_item.rb
39
+ - app/models/shipworks/audit.rb
39
40
  - app/models/shipworks/note.rb
40
41
  - app/models/shipworks/order.rb
41
42
  - app/models/shipworks/order_charge.rb