k_domain 0.0.32 → 0.0.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/k_domain.gemspec +1 -0
- data/lib/k_domain/domain_model/transform_steps/step.rb +4 -0
- data/lib/k_domain/domain_model/transform_steps/step2_domain_models.rb +2 -2
- data/lib/k_domain/rails_code_extractor/extract_controller.rb +1 -1
- data/lib/k_domain/rails_code_extractor/extract_model.rb +1 -0
- data/lib/k_domain/rails_code_extractor/shim_loader.rb +1 -1
- data/lib/k_domain/version.rb +1 -1
- data/lib/k_domain.rb +1 -0
- data/templates/custom/model_interceptors.rb +42 -7
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23080cbea3c4a31730c81e6f1a090346f3ee10949ac49bda936403b59887834c
|
4
|
+
data.tar.gz: 568b7d2c8e01e574c93d160f393f7cd4d183dd156dc4cfd60567a8ebfa8c194b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33b01df862eeb446e09cd5936687d25ce432ccc4213b52bd1371255597b37e343188d27c013560f81784e0eb6f5602285ffc6de193c45196c2f2b75772e4a7d9
|
7
|
+
data.tar.gz: ea2ec449e9c9455bc442c9a064fee395dd9d90b4b86d51c369cb037999847196c6511d1a78797ac5561f1a2d86a154fdaa619463df2bc9da090a078486aea582
|
data/Gemfile
CHANGED
@@ -28,6 +28,7 @@ end
|
|
28
28
|
if ENV.fetch('KLUE_LOCAL_GEMS', 'false').downcase == 'true'
|
29
29
|
group :development, :test do
|
30
30
|
puts 'Using Local GEMs'
|
31
|
+
gem 'cmdlet' , path: '../cmdlet'
|
31
32
|
gem 'k_log' , path: '../k_log'
|
32
33
|
gem 'k_util' , path: '../k_util'
|
33
34
|
gem 'peeky' , path: '../peeky'
|
data/k_domain.gemspec
CHANGED
@@ -40,6 +40,7 @@ Gem::Specification.new do |spec|
|
|
40
40
|
# spec.extensions = ['ext/k_domain/extconf.rb']
|
41
41
|
|
42
42
|
spec.add_dependency 'activesupport', '~> 7'
|
43
|
+
spec.add_dependency 'cmdlet'
|
43
44
|
spec.add_dependency 'dry-struct', '~> 1'
|
44
45
|
spec.add_dependency 'k_log' , '~> 0'
|
45
46
|
spec.add_dependency 'peeky' , '~> 0'
|
@@ -68,7 +68,7 @@ class Step2DomainModels < KDomain::DomainModel::Step
|
|
68
68
|
def check_type(type)
|
69
69
|
type = type.to_sym if type.is_a?(String)
|
70
70
|
|
71
|
-
return type if %i[string integer bigint bigserial boolean float decimal datetime date hstore text jsonb].include?(type)
|
71
|
+
return type if %i[string integer bigint bigserial boolean float decimal datetime date hstore text jsonb serial binary].include?(type)
|
72
72
|
|
73
73
|
if type.nil?
|
74
74
|
guard('nil type detected for db_column[:type]')
|
@@ -78,7 +78,7 @@ class Step2DomainModels < KDomain::DomainModel::Step
|
|
78
78
|
|
79
79
|
guard("new type detected for db_column[:type] - #{type}")
|
80
80
|
|
81
|
-
camel
|
81
|
+
camel(type.to_s).downcase
|
82
82
|
end
|
83
83
|
|
84
84
|
def column_data(name)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# Code extraction requires shims to be loaded before extraction
|
4
4
|
#
|
5
|
-
# This shims
|
5
|
+
# This shims serve two purposes
|
6
6
|
#
|
7
7
|
# 1. Inject data capture methods calls that intercept DSL macros so that data can be extracted
|
8
8
|
# 2. Inject fake module/classes that would otherwise break code loading with various exceptions
|
data/lib/k_domain/version.rb
CHANGED
data/lib/k_domain.rb
CHANGED
@@ -11,24 +11,60 @@ module ActsAsCommentable
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
+
module ActiveModel
|
15
|
+
module Validations
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
class ActiveRecord::Base
|
20
|
+
# def self.validate(*_p, **_o, &block); end
|
21
|
+
def self.validates_with(*_p, **_o, &block); end
|
22
|
+
def self.before_save(*_p, **_o, &block); end
|
23
|
+
def self.after_commit(*_p, **_o, &block); end
|
24
|
+
end
|
25
|
+
|
26
|
+
module Common
|
27
|
+
module Debug
|
28
|
+
module Timer
|
29
|
+
end
|
30
|
+
end
|
31
|
+
module Sanitizers
|
32
|
+
module UrlSanitizer; end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
class Base64
|
37
|
+
def self.decode64(*_p); end
|
38
|
+
end
|
14
39
|
|
15
40
|
module Scopes
|
16
41
|
module CompanyScopes
|
17
42
|
end
|
18
43
|
end
|
19
44
|
|
45
|
+
|
46
|
+
module Validators
|
47
|
+
module RuleValidator; end
|
48
|
+
end
|
49
|
+
|
50
|
+
class ApplicationRecord < ActiveRecord::Base
|
51
|
+
end
|
52
|
+
|
20
53
|
module DeIdentifiable
|
21
54
|
def deidentifiable(*_p, **_o); end
|
22
55
|
end
|
56
|
+
module Indexable
|
57
|
+
end
|
23
58
|
|
24
|
-
class Company <
|
59
|
+
class Company < ApplicationRecord
|
25
60
|
extend DeIdentifiable
|
26
61
|
end
|
27
|
-
class Estimate <
|
62
|
+
class Estimate < ApplicationRecord
|
28
63
|
extend DeIdentifiable
|
29
64
|
end
|
30
65
|
class Invoice < ActiveRecord::Base
|
31
66
|
extend DeIdentifiable
|
67
|
+
extend Indexable
|
32
68
|
end
|
33
69
|
class Address < ActiveRecord::Base
|
34
70
|
extend DeIdentifiable
|
@@ -37,14 +73,13 @@ class Contact < ActiveRecord::Base
|
|
37
73
|
extend DeIdentifiable
|
38
74
|
end
|
39
75
|
|
40
|
-
class Thread
|
41
|
-
def initialize(*_p, **_o, &block); end
|
42
|
-
end
|
43
76
|
|
44
|
-
class
|
77
|
+
class Shipment < ApplicationRecord
|
78
|
+
module Indexable
|
79
|
+
end
|
45
80
|
end
|
46
81
|
|
47
|
-
class Email <
|
82
|
+
class Email < ApplicationRecord
|
48
83
|
def self.ses_send(*_p, **_o); end
|
49
84
|
end
|
50
85
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: k_domain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Cruwys
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: cmdlet
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: dry-struct
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|