Sha256: af2b58e64adb0fc076f4bc2fda6eb3fde090ed727d850a5b962709d695543b42

Contents?: true

Size: 538 Bytes

Versions: 8

Compression:

Stored size: 538 Bytes

Contents

module SchemaPlus::ForeignKeys
  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

8 entries across 8 versions & 1 rubygems

Version Path
schema_plus-2.0.0.pre15 lib/schema_plus/foreign_keys/middleware/schema.rb
schema_plus-2.0.0.pre14 lib/schema_plus/foreign_keys/middleware/schema.rb
schema_plus-2.0.0.pre13 lib/schema_plus/foreign_keys/middleware/schema.rb
schema_plus-2.0.0.pre12 lib/schema_plus/foreign_keys/middleware/schema.rb
schema_plus-2.0.0.pre11 lib/schema_plus/foreign_keys/middleware/schema.rb
schema_plus-2.0.0.pre10 lib/schema_plus/foreign_keys/middleware/schema.rb
schema_plus-2.0.0.pre9 lib/schema_plus/foreign_keys/middleware/schema.rb
schema_plus-2.0.0.pre8 lib/schema_plus/foreign_keys/middleware/schema.rb