lib/rails-settings/settings.rb in jamesearl-rails-settings-1.0.4 vs lib/rails-settings/settings.rb in jamesearl-rails-settings-1.0.5
- old
+ new
@@ -36,13 +36,11 @@
#retrieve a value
else
#default behavior
- if self.connection.tables.include?(self.table_name)
+ if ActiveRecord::Base.connected? and self.connection.tables.include?(self.table_name)
self[method_name]
-
-
else #ENV is table not created
warn "#{self.table_name} table does not exist, fallback to ENV[#{method_name.upcase}]"
ENV[method_name.upcase]
end
end