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, limit: nil) ⇒ Object
155 156 157 158 159 |
# File 'lib/switchman/engine.rb', line 155 def self.foreign_key_check(name, type, limit: nil) 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
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/switchman/engine.rb', line 9 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 |