attribute_normalizer 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -62,7 +62,7 @@ module AttributeNormalizer
|
|
|
62
62
|
|
|
63
63
|
def inherited(subclass)
|
|
64
64
|
super
|
|
65
|
-
if subclass.respond_to?(:table_exists?) && subclass.table_exists?
|
|
65
|
+
if subclass.respond_to?(:table_exists?) && (subclass.table_exists? rescue false)
|
|
66
66
|
subclass.normalize_default_attributes
|
|
67
67
|
end
|
|
68
68
|
end
|
|
@@ -11,4 +11,16 @@ describe AttributeNormalizer do
|
|
|
11
11
|
klass.should respond_to(:normalize_attribute)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
+
it 'should not fail due to database exceptions raised by table_exists?' do
|
|
15
|
+
class PGError < RuntimeError; end
|
|
16
|
+
|
|
17
|
+
Class.new(ActiveRecord::Base) do
|
|
18
|
+
def self.table_exists?
|
|
19
|
+
raise PGError, "FATAL: something bad happened trying to probe for table existence"
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
include AttributeNormalizer
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
end
|
|
14
26
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: attribute_normalizer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 21
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 1
|
|
8
8
|
- 0
|
|
9
|
-
-
|
|
10
|
-
version: 1.0.
|
|
9
|
+
- 1
|
|
10
|
+
version: 1.0.1
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Michael Deering
|