lib/activerecord_snapshot_view/snapshot_view.rb
def switch_to(table)
        st = ensure_switch_table
        # want a transaction at least here [surround is ok too] so 
        # there is never an empty switch table
        ActiveRecord::Base.transaction do
          connection.execute( "delete from #{st}")
          connection.execute( "insert into #{st} values (\'#{table}\')")
        end
      end
# update switch table to point to a different table
update switch table to point to a different table
update switch table to point to a different table
def switch_to(table)
        st = ensure_switch_table
        ActiveRecord::Base.transaction do
          connection.execute( "delete from #{st}")
          connection.execute( "insert into #{st} values (\'#{table}\')")
        end
      end
def switch_to ( table ) st = ensure_switch_table ActiveRecord :: Base . transaction do connection . execute ( "delete from #{st}" ) connection . execute ( "insert into #{st} values (\'#{table}\')" ) end end
update switch table to point to a different table
update switch table to point to a different table
# want a transaction at least here [surround is ok too] so  # there is never an empty switch table
table