model_discovery 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/model_discovery/discovery.rb +8 -3
- data/lib/model_discovery/version.rb +1 -1
- 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: 7c52d22f56f5cd262ea40437897830fd4d059d96
|
4
|
+
data.tar.gz: 4a39a66efa793278a529a24d50be2c8ebc62c62d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 890b81d0086d594dc79c2239dae0421ea49cf6192309d114680a84edf9482d0022f1eff896607dda68b5bf8a6741b72bf50dfa84d2ccb8c65e5915afbaf7f164
|
7
|
+
data.tar.gz: 4298e62a1987b026c34854d86f57459b396096ec0b8812f90069a600e8bef83f6ac82cfddcaaac586c31d976084cf752c06fc6047659b06d0fa5a990ca079a61
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module ModelDiscovery
|
2
2
|
|
3
3
|
# Create a list of current rails application tables or documents
|
4
|
-
def self.build_table_list
|
4
|
+
def self.build_table_list(without_habtm = true)
|
5
5
|
# Get all gem by requiring them
|
6
6
|
all_gems = Bundler.require()
|
7
7
|
|
@@ -20,13 +20,18 @@ module ModelDiscovery
|
|
20
20
|
if defined? ActiveRecord
|
21
21
|
# Create a content type entry for all Models
|
22
22
|
ActiveRecord::Base.subclasses.each do |model|
|
23
|
-
|
23
|
+
#unless model.name.to_s.starts_with? 'HABTM_'
|
24
|
+
if !model.name.to_s.starts_with?('HABTM_') && !without_habtm
|
25
|
+
ApplicationModels.find_or_create_by(model: model.name)
|
26
|
+
end
|
24
27
|
end
|
25
28
|
end
|
26
29
|
|
27
30
|
if defined? Mongoid
|
28
31
|
Mongoid.models.each do |model|
|
29
|
-
|
32
|
+
if !model.name.to_s.starts_with?('HABTM_') && !without_habtm
|
33
|
+
ApplicationModels.find_or_create_by(model: model.name)
|
34
|
+
end
|
30
35
|
end
|
31
36
|
end
|
32
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: model_discovery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sameer Rahmani
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|