jamesearl-rails-settings 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -0
- data/lib/rails-settings/settings.rb +10 -2
- data/lib/rails-settings/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -36,8 +36,16 @@ class Settings < ActiveRecord::Base
|
|
36
36
|
|
37
37
|
#retrieve a value
|
38
38
|
else
|
39
|
-
|
40
|
-
|
39
|
+
|
40
|
+
#default behavior
|
41
|
+
if self.connection.tables.include?(self.table_name)
|
42
|
+
self[method_name]
|
43
|
+
|
44
|
+
|
45
|
+
else #ENV is table not created
|
46
|
+
warn "#{self.table_name} table does not exist, fallback to ENV[#{method_name.upcase}]"
|
47
|
+
ENV[method_name.upcase]
|
48
|
+
end
|
41
49
|
end
|
42
50
|
end
|
43
51
|
end
|