Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paranoia
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
paranoia
Commits
90471cdb
Commit
90471cdb
authored
Jan 31, 2016
by
Weston Ganger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added_with_default_scope_option
parent
3d65a934
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
test/paranoia_test.rb
+11
-0
No files found.
test/paranoia_test.rb
View file @
90471cdb
...
@@ -204,6 +204,13 @@ class ParanoiaTest < test_framework
...
@@ -204,6 +204,13 @@ class ParanoiaTest < test_framework
assert_equal
nil
,
ParanoidModel
.
paranoia_sentinel_value
assert_equal
nil
,
ParanoidModel
.
paranoia_sentinel_value
end
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
def
test_active_column_model
model
=
ActiveColumnModel
.
new
model
=
ActiveColumnModel
.
new
assert_equal
0
,
model
.
class
.
count
assert_equal
0
,
model
.
class
.
count
...
@@ -1042,6 +1049,10 @@ class CustomSentinelModel < ActiveRecord::Base
...
@@ -1042,6 +1049,10 @@ class CustomSentinelModel < ActiveRecord::Base
acts_as_paranoid
sentinel_value:
DateTime
.
new
(
0
)
acts_as_paranoid
sentinel_value:
DateTime
.
new
(
0
)
end
end
class
WithoutDefaultScopeModel
<
ActiveRecord
::
Base
acts_as_paranoid
without_default_scope:
true
end
class
ActiveColumnModel
<
ActiveRecord
::
Base
class
ActiveColumnModel
<
ActiveRecord
::
Base
acts_as_paranoid
column: :active
,
sentinel_value:
true
acts_as_paranoid
column: :active
,
sentinel_value:
true
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment