Sha256: 8219e6068a1a49f1157bd0de3517694dcb592fbe679d3ba60a0a7ea494d28b15
Contents?: true
Size: 536 Bytes
Versions: 5
Compression:
Stored size: 536 Bytes
Contents
module SchemaAutoForeignKeys module Middleware module Schema module Define def around(env) fk_override = { :auto_create => false, :auto_index => false } save = Hash[fk_override.keys.collect{|key| [key, SchemaPlus::ForeignKeys.config.send(key)]}] begin SchemaPlus::ForeignKeys.config.update_attributes(fk_override) yield env ensure SchemaPlus::ForeignKeys.config.update_attributes(save) end end end end end end
Version data entries
5 entries across 5 versions & 2 rubygems