Sha256: 46a5a7285926011b47ffe6b982aced82965a06bdf167c1600ea67b806ad9d2f2
Contents?: true
Size: 1018 Bytes
Versions: 1
Compression:
Stored size: 1018 Bytes
Contents
require "scenic/active_record/command_recorder/statement_arguments" module Scenic module ActiveRecord module CommandRecorder def create_view(*args) record(:create_view, args) end def drop_view(*args) record(:drop_view, args) end def update_view(*args) record(:update_view, args) end def invert_create_view(args) [:drop_view, args] end def invert_drop_view(args) perform_scenic_inversion(:create_view, args) end def invert_update_view(args) perform_scenic_inversion(:update_view, args) end private def perform_scenic_inversion(method, args) scenic_args = StatementArguments.new(args) if scenic_args.revert_to_version.nil? message = "#{method} is reversible only if given a revert_to_version" raise ::ActiveRecord::IrreversibleMigration, message end [method, scenic_args.invert_version.to_a] end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
scenic-0.1.0 | lib/scenic/active_record/command_recorder.rb |