rails-erd 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rails_erd/domain/entity.rb +1 -1
- data/lib/rails_erd/domain/specialization.rb +16 -2
- data/lib/rails_erd/version.rb +1 -1
- metadata +2 -3
- data/LICENSE +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ab56fc63661711b90e26347a430db4ade715904
|
4
|
+
data.tar.gz: 33656498d2b249fe4f8ab7cf462f70e9e85b3fed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aec8e77aa5ba7c424ae2f3322d35c944b5f20f41e07aadeff9da0c606414dddc0d70f05457b0863d2c9c6693db25dce68573b7e7a2fe65194e3e3a9c07bb1c47
|
7
|
+
data.tar.gz: 09ebb3782261d1ce42e628116288ccfc6360e2e2fd348a298e4490bc615175e022b7d9df7d6363dd41f1a306b43cfc54282772b24315f5b5bb97b0382ab1c254
|
@@ -30,7 +30,7 @@ module RailsERD
|
|
30
30
|
# The Active Record model that this entity corresponds to.
|
31
31
|
attr_reader :model
|
32
32
|
|
33
|
-
# The name of this entity. Equal to the class name of the
|
33
|
+
# The name of this entity. Equal to the class name of the corresponding
|
34
34
|
# model (for concrete entities) or given name (for abstract entities).
|
35
35
|
attr_reader :name
|
36
36
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module RailsERD
|
2
2
|
class Domain
|
3
|
-
# Describes the specialization of an entity. Specialized
|
3
|
+
# Describes the specialization of an entity. Specialized entities correspond
|
4
4
|
# to inheritance or polymorphism. In Rails, specialization is referred to
|
5
5
|
# as single table inheritance, while generalization is referred to as
|
6
6
|
# polymorphism or abstract classes.
|
@@ -49,7 +49,9 @@ module RailsERD
|
|
49
49
|
attr_reader :specialized
|
50
50
|
|
51
51
|
def initialize(domain, generalized, specialized) # @private :nodoc:
|
52
|
-
@domain
|
52
|
+
@domain = domain
|
53
|
+
@generalized = generalized || NullGeneralized.new
|
54
|
+
@specialized = specialized || NullSpecialization.new
|
53
55
|
end
|
54
56
|
|
55
57
|
def generalization?
|
@@ -66,5 +68,17 @@ module RailsERD
|
|
66
68
|
(generalized.name <=> other.generalized.name).nonzero? or (specialized.name <=> other.specialized.name)
|
67
69
|
end
|
68
70
|
end
|
71
|
+
|
72
|
+
class NullSpecialization
|
73
|
+
def name
|
74
|
+
""
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
class NullGeneralized
|
79
|
+
def name
|
80
|
+
""
|
81
|
+
end
|
82
|
+
end
|
69
83
|
end
|
70
84
|
end
|
data/lib/rails_erd/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-erd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rolf Timmermans
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -75,7 +75,6 @@ executables:
|
|
75
75
|
extensions: []
|
76
76
|
extra_rdoc_files: []
|
77
77
|
files:
|
78
|
-
- LICENSE
|
79
78
|
- README.md
|
80
79
|
- Rakefile
|
81
80
|
- bin/erd
|
data/LICENSE
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
Copyright (c) 2010-2013 Voormedia B.V.
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
of this software and associated documentation files (the "Software"), to deal
|
5
|
-
in the Software without restriction, including without limitation the rights
|
6
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
copies of the Software, and to permit persons to whom the Software is
|
8
|
-
furnished to do so, subject to the following conditions:
|
9
|
-
|
10
|
-
The above copyright notice and this permission notice shall be included in
|
11
|
-
all copies or substantial portions of the Software.
|
12
|
-
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
-
THE SOFTWARE.
|