Sha256: 8a355b8d080f7f35040f5bd71e1eb6bcb5cd035bb0b184bb70d4dace75f0c5a3

Contents?: true

Size: 529 Bytes

Versions: 2

Compression:

Stored size: 529 Bytes

Contents

module SchemaPlus::Views
  module ActiveRecord
    module Migration
      module CommandRecorder
        def create_view(*args, &block)
          record(:create_view, args, &block)
        end

        def drop_view(*args, &block)
          record(:drop_view, args, &block)
        end

        def invert_create_view(args)
          options = {}
          options[:materialized] = args[2][:materialized] if args[2].has_key?(:materialized)
          [ :drop_view, [args.first, options] ]
        end

      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
schema_plus_views-0.4.1 lib/schema_plus/views/active_record/migration/command_recorder.rb
schema_plus_views-0.4.0 lib/schema_plus/views/active_record/migration/command_recorder.rb