Commit 90471cdb by Weston Ganger

added_with_default_scope_option

parent 3d65a934
......@@ -204,6 +204,13 @@ class ParanoiaTest < test_framework
assert_equal nil, ParanoidModel.paranoia_sentinel_value
end
def test_without_default_scope_option
model = WithoutDefaultScopeModel.create!(name: "A", deleted_at: Time.now)
assert_equal 1, model.class.count
assert_equal 1, model.class.only_deleted.count
assert_equal 0, model.class.without_deleted.count
end
def test_active_column_model
model = ActiveColumnModel.new
assert_equal 0, model.class.count
......@@ -1042,6 +1049,10 @@ class CustomSentinelModel < ActiveRecord::Base
acts_as_paranoid sentinel_value: DateTime.new(0)
end
class WithoutDefaultScopeModel < ActiveRecord::Base
acts_as_paranoid without_default_scope: true
end
class ActiveColumnModel < ActiveRecord::Base
acts_as_paranoid column: :active, sentinel_value: true
......
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