Commit c63e0ab0 by John Hawthorn Committed by GitHub

Merge branch 'core' into paranoia_aliases

parents 0f25822c acd43c15
......@@ -3,7 +3,7 @@ source 'https://rubygems.org'
gem 'sqlite3', platforms: [:ruby]
platforms :jruby do
gem 'activerecord-jdbcsqlite3-adapter', github: 'jruby/activerecord-jdbc-adapter', branch: 'rails-5'
gem 'activerecord-jdbcsqlite3-adapter'
end
platforms :rbx do
......@@ -12,7 +12,7 @@ platforms :rbx do
gem 'rubinius-developer_tools'
end
rails = ENV['RAILS'] || '~> 4.2.0'
rails = ENV['RAILS'] || '~> 5.1.0'
gem 'rails', rails
......
......@@ -151,7 +151,7 @@ module Paranoia
association_data.really_destroy!
end
end
write_attribute(paranoia_column, current_time_from_proper_timezone)
update_columns(paranoia_destroy_attributes)
destroy_without_paranoia
end
end
......
......@@ -5,6 +5,10 @@ require 'paranoia'
test_framework = defined?(MiniTest::Test) ? MiniTest::Test : MiniTest::Unit::TestCase
if ActiveRecord::Base.respond_to?(:raise_in_transactional_callbacks=)
ActiveRecord::Base.raise_in_transactional_callbacks = true
end
def connect!
ActiveRecord::Base.establish_connection :adapter => 'sqlite3', database: ':memory:'
end
......@@ -546,6 +550,14 @@ class ParanoiaTest < test_framework
assert model.instance_variable_get(:@real_destroy_callback_called)
end
def test_really_destroy_behavior_for_active_column_model
model = ActiveColumnModel.new
model.save
model.really_destroy!
refute ParanoidModel.unscoped.exists?(model.id)
end
def test_really_delete
model = ParanoidModel.new
model.save
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment