rails-erd 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rails_erd/diagram.rb +2 -2
- data/lib/rails_erd/domain/attribute.rb +1 -0
- data/lib/rails_erd/version.rb +1 -1
- data/test/unit/diagram_test.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ced613d31cc40de9c81c7e176f08426b2ceb443
|
4
|
+
data.tar.gz: e8a7613baef3dee1c6eb409c1bb6dfa47a5baeac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4c95e24c1cc9c5b1842fda8c3e538e3c4d52bb0c12d9124ab130b2041120803193e60fb278f61c12652a7df5fc7d85a90a58e4b461bdf83fb06ed4bbd26d256
|
7
|
+
data.tar.gz: fcd3a51c29f28351bb50aecc73b47432675cfcc349079656a91a1e850316d71d2924171186749d653e1d1bdc04a2a68da01b4ebd10948fff8eae18d3df6ea7ec
|
data/lib/rails_erd/diagram.rb
CHANGED
@@ -150,8 +150,8 @@ module RailsERD
|
|
150
150
|
|
151
151
|
def filtered_entities
|
152
152
|
@domain.entities.reject { |entity|
|
153
|
-
options.exclude && entity.model && [options.exclude].flatten.include?(entity.name.to_sym) or
|
154
|
-
options.only && entity.model && ![options.only].flatten.include?(entity.name.to_sym) or
|
153
|
+
options.exclude && entity.model && [options.exclude].flatten.map(&:to_sym).include?(entity.name.to_sym) or
|
154
|
+
options.only && entity.model && ![options.only].flatten.map(&:to_sym).include?(entity.name.to_sym) or
|
155
155
|
!options.inheritance && entity.specialized? or
|
156
156
|
!options.polymorphism && entity.generalized? or
|
157
157
|
!options.disconnected && entity.disconnected?
|
@@ -125,6 +125,7 @@ module RailsERD
|
|
125
125
|
# Returns any non-standard limit for this attribute. If a column has no
|
126
126
|
# limit or uses a default database limit, this method returns +nil+.
|
127
127
|
def limit
|
128
|
+
return if native_type == 'geometry'
|
128
129
|
return column.limit.to_i if column.limit != native_type[:limit] and column.limit.respond_to?(:to_i)
|
129
130
|
column.precision.to_i if column.precision != native_type[:precision] and column.precision.respond_to?(:to_i)
|
130
131
|
end
|
data/lib/rails_erd/version.rb
CHANGED
data/test/unit/diagram_test.rb
CHANGED
@@ -149,6 +149,13 @@ class DiagramTest < ActiveSupport::TestCase
|
|
149
149
|
assert_equal [Author, Editor], retrieve_entities(:only => [:Author, :Editor]).map(&:model)
|
150
150
|
end
|
151
151
|
|
152
|
+
test "generate should include only specified entities (With the class names as strings)" do
|
153
|
+
create_model "Book"
|
154
|
+
create_model "Author"
|
155
|
+
create_model "Editor"
|
156
|
+
assert_equal [Author, Editor], retrieve_entities(:only => ['Author', 'Editor']).map(&:model)
|
157
|
+
end
|
158
|
+
|
152
159
|
test "generate should filter disconnected entities if disconnected is false" do
|
153
160
|
create_model "Book", :author => :references do
|
154
161
|
belongs_to :author
|
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.4.
|
4
|
+
version: 1.4.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: 2015-
|
11
|
+
date: 2015-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|