lib/activerecord_snapshot_view/snapshot_view.rb
def prepare_to_migrate
        if active_table_name != base_table_name
          connection.execute( "truncate table #{base_table_name}" )
          connection.execute( "insert into #{base_table_name} select * from #{active_table_name}" )
        end
        suffixed_table_names.each do |stn|
          connection.execute( "drop table if exists #{stn}" )
        end
        connection.execute( "drop table if exists #{switch_table_name}" )
      end
# copy all data to base table, reset switch table and drop suffixed tables... for migration support
copy all data to base table, reset switch table and drop suffixed tables... for migration support
copy all data to base table reset switch table and drop suffixed tables ... for migration support
def prepare_to_migrate
        if active_table_name != base_table_name
          connection.execute( "truncate table #{base_table_name}" )
          connection.execute( "insert into #{base_table_name} select * from #{active_table_name}" )
        end
        suffixed_table_names.each do |stn|
          connection.execute( "drop table if exists #{stn}" )
        end
        connection.execute( "drop table if exists #{switch_table_name}" )
      end
def prepare_to_migrate if active_table_name != base_table_name connection . execute ( "truncate table #{base_table_name}" ) connection . execute ( "insert into #{base_table_name} select * from #{active_table_name}" ) end suffixed_table_names . each do | stn | connection . execute ( "drop table if exists #{stn}" ) end connection . execute ( "drop table if exists #{switch_table_name}" ) end
copy all data to base table, reset switch table and drop suffixed tables... for migration support
copy all data to base table reset switch table and drop suffixed tables ... for migration support