lib/activerecord_snapshot_view/snapshot_view.rb
def advance_version
        switch_to(working_table_name)

        # ensure the presence of the new active and working tables. 
        # happens after the switch table update, since this may commit a surrounding 
        # transaction in dbs with retarded non-transactional ddl like, oh i dunno, MyFuckingSQL
        ensure_version_table(active_table_name)

        # recreate the new working table from the base schema. 
        new_wtn = working_table_name
        if new_wtn != base_table_name
          dup_table_schema(base_table_name, new_wtn)
        else
          connection.execute( "truncate table #{new_wtn}" )
        end
      end
# make working table active, then recreate new working table from base table schema
make working table active, then recreate new working table from base table schema
make working table active then recreate new working table from base table schema
def advance_version
        switch_to(working_table_name)
        ensure_version_table(active_table_name)
        new_wtn = working_table_name
        if new_wtn != base_table_name
          dup_table_schema(base_table_name, new_wtn)
        else
          connection.execute( "truncate table #{new_wtn}" )
        end
      end
def advance_version switch_to ( working_table_name ) ensure_version_table ( active_table_name ) new_wtn = working_table_name if new_wtn != base_table_name dup_table_schema ( base_table_name , new_wtn ) else connection . execute ( "truncate table #{new_wtn}" ) end end
make working table active, then recreate new working table from base table schema
make working table active then recreate new working table from base table schema
# ensure the presence of the new active and working tables.  # happens after the switch table update, since this may commit a surrounding  # transaction in dbs with retarded non-transactional ddl like, oh i dunno, MyFuckingSQL # recreate the new working table from the base schema. 