jamesearl-rails-settings 1.0.3 → 1.0.4

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.
data/README.md CHANGED
@@ -10,6 +10,8 @@ Example:
10
10
 
11
11
  Note the upcase.
12
12
 
13
+ If the Settings table doesn't exist, this will warn and fallback to ENV vars.
14
+
13
15
 
14
16
  # Settings Gem/Plugin for Rails
15
17
 
@@ -36,8 +36,16 @@ class Settings < ActiveRecord::Base
36
36
 
37
37
  #retrieve a value
38
38
  else
39
- self[method_name]
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
@@ -1,3 +1,3 @@
1
1
  module RailsSettings
2
- VERSION = '1.0.3'
2
+ VERSION = '1.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jamesearl-rails-settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: