erp_tech_svcs 3.0.6 → 3.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/audit_log.rb +27 -4
- data/app/models/audit_log_item.rb +3 -0
- data/lib/erp_tech_svcs/version.rb +1 -1
- metadata +22 -65
- data/spec/dummy/db/schema.rb +0 -600
- data/spec/dummy/db/spec.sqlite3 +0 -0
- data/spec/dummy/log/adam.log +0 -1
- data/spec/dummy/log/spec.log +0 -80513
data/app/models/audit_log.rb
CHANGED
@@ -1,13 +1,36 @@
|
|
1
1
|
class AuditLog < ActiveRecord::Base
|
2
2
|
|
3
|
-
validates :party_id, :presence => {:message => '
|
4
|
-
validates :description, :presence => {:message => '
|
5
|
-
validates :audit_log_type, :presence => {:message => '
|
3
|
+
validates :party_id, :presence => {:message => 'cannot be blank'}
|
4
|
+
validates :description, :presence => {:message => 'cannot be blank'}
|
5
|
+
validates :audit_log_type, :presence => {:message => 'cannot be blank'}
|
6
6
|
|
7
7
|
belongs_to :audit_log_type
|
8
8
|
belongs_to :party
|
9
|
-
has_many :audit_log_items
|
10
9
|
belongs_to :event_record, :polymorphic => true
|
10
|
+
has_many :audit_log_items, :dependent => :destroy
|
11
|
+
|
12
|
+
alias :items :audit_log_items
|
13
|
+
alias :type :audit_log_type
|
14
|
+
|
15
|
+
def get_item_by_item_type_internal_identifier(item_type_internal_identifier)
|
16
|
+
self.items.includes(:audit_log_item_type)
|
17
|
+
.where(:audit_log_item_types => {:internal_identifier => item_type_internal_identifier}).first
|
18
|
+
end
|
19
|
+
|
20
|
+
#allow items to be looked up by method calls
|
21
|
+
def respond_to?(m)
|
22
|
+
(super ? true : get_item_by_item_type_internal_identifier(m.to_s)) rescue super
|
23
|
+
end
|
24
|
+
|
25
|
+
#allow items to be looked up by method calls
|
26
|
+
def method_missing(m, *args, &block)
|
27
|
+
if self.respond_to?(m)
|
28
|
+
item = get_item_by_item_type_internal_identifier(m.to_s)
|
29
|
+
(item.nil?) ? super : (return item.value)
|
30
|
+
else
|
31
|
+
super
|
32
|
+
end
|
33
|
+
end
|
11
34
|
|
12
35
|
class << self
|
13
36
|
def custom_application_log_message(party, msg)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: erp_tech_svcs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: erp_base_erp_svcs
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70145423437960 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,15 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '3.0'
|
24
|
+
version_requirements: *70145423437960
|
30
25
|
- !ruby/object:Gem::Dependency
|
31
26
|
name: erp_dev_svcs
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
27
|
+
requirement: &70145423437460 !ruby/object:Gem::Requirement
|
33
28
|
none: false
|
34
29
|
requirements:
|
35
30
|
- - ~>
|
@@ -37,92 +32,62 @@ dependencies:
|
|
37
32
|
version: '3.0'
|
38
33
|
type: :development
|
39
34
|
prerelease: false
|
40
|
-
version_requirements:
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '3.0'
|
35
|
+
version_requirements: *70145423437460
|
46
36
|
- !ruby/object:Gem::Dependency
|
47
37
|
name: aws-sdk
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
38
|
+
requirement: &70145423437000 !ruby/object:Gem::Requirement
|
49
39
|
none: false
|
50
40
|
requirements:
|
51
|
-
- -
|
41
|
+
- - =
|
52
42
|
- !ruby/object:Gem::Version
|
53
43
|
version: 1.5.2
|
54
44
|
type: :runtime
|
55
45
|
prerelease: false
|
56
|
-
version_requirements:
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- - '='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 1.5.2
|
46
|
+
version_requirements: *70145423437000
|
62
47
|
- !ruby/object:Gem::Dependency
|
63
48
|
name: delayed_job_active_record
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
49
|
+
requirement: &70145423436540 !ruby/object:Gem::Requirement
|
65
50
|
none: false
|
66
51
|
requirements:
|
67
|
-
- -
|
52
|
+
- - =
|
68
53
|
- !ruby/object:Gem::Version
|
69
54
|
version: 0.3.2
|
70
55
|
type: :runtime
|
71
56
|
prerelease: false
|
72
|
-
version_requirements:
|
73
|
-
none: false
|
74
|
-
requirements:
|
75
|
-
- - '='
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: 0.3.2
|
57
|
+
version_requirements: *70145423436540
|
78
58
|
- !ruby/object:Gem::Dependency
|
79
59
|
name: paperclip
|
80
|
-
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirement: &70145423436080 !ruby/object:Gem::Requirement
|
81
61
|
none: false
|
82
62
|
requirements:
|
83
|
-
- -
|
63
|
+
- - =
|
84
64
|
- !ruby/object:Gem::Version
|
85
65
|
version: 3.0.2
|
86
66
|
type: :runtime
|
87
67
|
prerelease: false
|
88
|
-
version_requirements:
|
89
|
-
none: false
|
90
|
-
requirements:
|
91
|
-
- - '='
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: 3.0.2
|
68
|
+
version_requirements: *70145423436080
|
94
69
|
- !ruby/object:Gem::Dependency
|
95
70
|
name: pdfkit
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirement: &70145423435620 !ruby/object:Gem::Requirement
|
97
72
|
none: false
|
98
73
|
requirements:
|
99
|
-
- -
|
74
|
+
- - =
|
100
75
|
- !ruby/object:Gem::Version
|
101
76
|
version: 0.4.6
|
102
77
|
type: :runtime
|
103
78
|
prerelease: false
|
104
|
-
version_requirements:
|
105
|
-
none: false
|
106
|
-
requirements:
|
107
|
-
- - '='
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: 0.4.6
|
79
|
+
version_requirements: *70145423435620
|
110
80
|
- !ruby/object:Gem::Dependency
|
111
81
|
name: sorcery
|
112
|
-
requirement: !ruby/object:Gem::Requirement
|
82
|
+
requirement: &70145423435160 !ruby/object:Gem::Requirement
|
113
83
|
none: false
|
114
84
|
requirements:
|
115
|
-
- -
|
85
|
+
- - =
|
116
86
|
- !ruby/object:Gem::Version
|
117
87
|
version: 0.7.12
|
118
88
|
type: :runtime
|
119
89
|
prerelease: false
|
120
|
-
version_requirements:
|
121
|
-
none: false
|
122
|
-
requirements:
|
123
|
-
- - '='
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version: 0.7.12
|
90
|
+
version_requirements: *70145423435160
|
126
91
|
description: This engine is implemented with the premise that services like logging,
|
127
92
|
tracing and encryption would likely already exist in many organizations, so they
|
128
93
|
are factored here so they can easily be re-implemented. There are default implementations
|
@@ -236,10 +201,6 @@ files:
|
|
236
201
|
- spec/dummy/config/locales/en.yml
|
237
202
|
- spec/dummy/config/routes.rb
|
238
203
|
- spec/dummy/config.ru
|
239
|
-
- spec/dummy/db/schema.rb
|
240
|
-
- spec/dummy/db/spec.sqlite3
|
241
|
-
- spec/dummy/log/adam.log
|
242
|
-
- spec/dummy/log/spec.log
|
243
204
|
- spec/dummy/public/404.html
|
244
205
|
- spec/dummy/public/422.html
|
245
206
|
- spec/dummy/public/500.html
|
@@ -279,7 +240,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
279
240
|
version: '0'
|
280
241
|
requirements: []
|
281
242
|
rubyforge_project:
|
282
|
-
rubygems_version: 1.8.
|
243
|
+
rubygems_version: 1.8.11
|
283
244
|
signing_key:
|
284
245
|
specification_version: 3
|
285
246
|
summary: This engine is implemented with the premise that services like logging, tracing
|
@@ -306,10 +267,6 @@ test_files:
|
|
306
267
|
- spec/dummy/config/locales/en.yml
|
307
268
|
- spec/dummy/config/routes.rb
|
308
269
|
- spec/dummy/config.ru
|
309
|
-
- spec/dummy/db/schema.rb
|
310
|
-
- spec/dummy/db/spec.sqlite3
|
311
|
-
- spec/dummy/log/adam.log
|
312
|
-
- spec/dummy/log/spec.log
|
313
270
|
- spec/dummy/public/404.html
|
314
271
|
- spec/dummy/public/422.html
|
315
272
|
- spec/dummy/public/500.html
|