Class: Switchman::Engine
- Inherits:
-
Rails::Engine
- Object
- Rails::Engine
- Switchman::Engine
- Defined in:
- lib/switchman/engine.rb
Class Method Summary collapse
Class Method Details
.foreign_key_check(name, type, options) ⇒ Object
157 158 159 160 161 |
# File 'lib/switchman/engine.rb', line 157 def self.foreign_key_check(name, type, ) if name.to_s =~ /_id\z/ && type.to_s == 'integer' && [:limit].to_i < 8 puts "WARNING: All foreign keys need to be 8-byte integers. #{name} looks like a foreign key. If so, please add the option: `:limit => 8`" end end |
.lookup_stores(cache_store_config) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/switchman/engine.rb', line 7 def self.lookup_stores(cache_store_config) result = {} cache_store_config.each do |key, value| next if value.is_a?(String) result[key] = ::ActiveSupport::Cache.lookup_store(value) end cache_store_config.each do |key, value| next unless value.is_a?(String) result[key] = result[value] end result end |