active_mocker 1.2.pre.5 → 1.2.pre.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_mocker/generate.rb +9 -0
- data/lib/active_mocker/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7f3415a7c6d4afd5d48bd065aa392c1000204e3
|
4
|
+
data.tar.gz: 3400e4350fd4ebad56df688996d423cf354e5a61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6388bf35664471b9704596dd8be5668425ca3cbc5e7d6f70f4d8959d3eec9d1e017b872656bea090cb0bb6002e9f97116cdf6750cdea18a39b38acabb1cf6fca
|
7
|
+
data.tar.gz: 879eceeb2ae425f53aa88aa6ec8fcb31f289d5bf48b37c92f0cfdd4a30620b326692bc01fb32353e56ee3482bbf4dd93a5cc4019219c5a507b2495a0163d56bf
|
@@ -31,6 +31,15 @@ class Generate
|
|
31
31
|
"#{model_name}Mock".constantize
|
32
32
|
end
|
33
33
|
|
34
|
+
def class_exists?(class_name)
|
35
|
+
begin
|
36
|
+
klass = Module.const_get(class_name)
|
37
|
+
return klass.is_a?(Class)
|
38
|
+
rescue NameError
|
39
|
+
return false
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
34
43
|
def model_definition(table)
|
35
44
|
return @model_definition if @model_definition_table == table
|
36
45
|
@model_definition_table = table
|