partial_ks 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/CONTRIBUTING.md +1 -1
- data/lib/partial_ks/configuration_generator.rb +6 -1
- data/lib/partial_ks/version.rb +1 -1
- data/test/configuration_generator_test.rb +7 -0
- data/test/setup_models.rb +5 -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: 38febb0d43538e1c658e595dfa1b690669e9366b
|
4
|
+
data.tar.gz: f518ef601cb41bf1fc480e75269fdb2d7723c45e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dba5fdfc838d88f1bac8900d1e7e119da31868acbbe54103753a4c8cf9d6f5181bc1358c66ba7c66cdb993dd483519c8cb63a1d041a91b602373d7887be4985
|
7
|
+
data.tar.gz: 5eb5e046f03bf8fc15b31ca96d50966a591d5496d95d24ce47a00df83427e9d39f620709cbe7f2ec415310fe67291a4347ed0c4e7e0d8518f1c5ea41e66c5dda
|
data/CHANGES.md
CHANGED
data/CONTRIBUTING.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# and attempts to automatically populate the table into the table graph
|
4
4
|
module PartialKs
|
5
5
|
class ConfigurationGenerator
|
6
|
-
attr_reader :manual_configuration
|
6
|
+
attr_reader :manual_configuration
|
7
7
|
|
8
8
|
def initialize(manual_configuration, models: nil)
|
9
9
|
@manual_configuration = manual_configuration
|
@@ -19,6 +19,11 @@ module PartialKs
|
|
19
19
|
@all_tables ||= models.map {|model| PartialKs::Table.new(model) }.select(&:model?).index_by(&:table_name)
|
20
20
|
end
|
21
21
|
|
22
|
+
def models
|
23
|
+
tables_in_database = ActiveRecord::Base.connection.tables
|
24
|
+
@models.select{|model| tables_in_database.include?(model.table_name)}
|
25
|
+
end
|
26
|
+
|
22
27
|
def filtered_tables
|
23
28
|
synced_tables = {}
|
24
29
|
|
data/lib/partial_ks/version.rb
CHANGED
@@ -38,4 +38,11 @@ describe "generating dependencies" do
|
|
38
38
|
["cms_table", nil, nil]
|
39
39
|
]
|
40
40
|
end
|
41
|
+
|
42
|
+
it "does not choke on a table which has had its migration run" do
|
43
|
+
generator(manual_configuration, models: [User, NewModel]).
|
44
|
+
must_equal [
|
45
|
+
["users", nil, User.where(:id => [1])],
|
46
|
+
]
|
47
|
+
end
|
41
48
|
end
|
data/test/setup_models.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: partial_ks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thong Kuah
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|