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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 537ccea2a689d7fc5eafcf6879b4f72f9a143c63
4
- data.tar.gz: 22934779369b6203496dc48792b5442697131bfd
3
+ metadata.gz: 6ced613d31cc40de9c81c7e176f08426b2ceb443
4
+ data.tar.gz: e8a7613baef3dee1c6eb409c1bb6dfa47a5baeac
5
5
  SHA512:
6
- metadata.gz: 1539881900c1f05e0dbafbfba086dd4bcfee51a323c608b5f7d02b362d69818e9c7543a93e4a6d40f18443a243fefe2518fe944507983c466f7ca8724f1e01c3
7
- data.tar.gz: 91502bc3daa15a4aff18bdd0cfd1b6993b1b8607f5aed5f5a224d4c36dfd99b5f1fc7d755a29242cdd9c14f726b2aff6fbc55eefcf8d402ee6a04de51cd37a6d
6
+ metadata.gz: b4c95e24c1cc9c5b1842fda8c3e538e3c4d52bb0c12d9124ab130b2041120803193e60fb278f61c12652a7df5fc7d85a90a58e4b461bdf83fb06ed4bbd26d256
7
+ data.tar.gz: fcd3a51c29f28351bb50aecc73b47432675cfcc349079656a91a1e850316d71d2924171186749d653e1d1bdc04a2a68da01b4ebd10948fff8eae18d3df6ea7ec
@@ -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
@@ -1,4 +1,4 @@
1
1
  module RailsERD
2
- VERSION = "1.4.1"
2
+ VERSION = "1.4.2"
3
3
  BANNER = "RailsERD #{VERSION}"
4
4
  end
@@ -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.1
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-07-03 00:00:00.000000000 Z
11
+ date: 2015-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord