Module: SchemaPlus::Views::ActiveRecord::Migration::CommandRecorder

Defined in:
lib/schema_plus/views/active_record/migration/command_recorder.rb

Instance Method Summary collapse

Instance Method Details

#create_view(*args, &block) ⇒ Object



5
6
7
# File 'lib/schema_plus/views/active_record/migration/command_recorder.rb', line 5

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

#drop_view(*args, &block) ⇒ Object



9
10
11
# File 'lib/schema_plus/views/active_record/migration/command_recorder.rb', line 9

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

#invert_create_view(args) ⇒ Object



13
14
15
16
17
# File 'lib/schema_plus/views/active_record/migration/command_recorder.rb', line 13

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