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
d97417a2
Commit
d97417a2
authored
Jan 18, 2015
by
John Hawthorn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add additional test against polymorphic has_one
To ensure that we are using the association _type in our scope.
parent
f63ccc7f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
test/paranoia_test.rb
+15
-0
No files found.
test/paranoia_test.rb
View file @
d97417a2
...
@@ -671,6 +671,21 @@ class ParanoiaTest < test_framework
...
@@ -671,6 +671,21 @@ class ParanoiaTest < test_framework
assert_equal
1
,
polymorphic
.
class
.
count
assert_equal
1
,
polymorphic
.
class
.
count
end
end
# Ensure that we're checking parent_type when restoring
def
test_missing_restore_recursive_on_polymorphic_has_one_association
parent
=
ParentModel
.
create
polymorphic
=
PolymorphicModel
.
create
(
parent_id:
parent
.
id
,
parent_type:
'ParanoidModel'
)
parent
.
destroy
polymorphic
.
destroy
assert_equal
0
,
polymorphic
.
class
.
count
parent
.
restore
(
recursive:
true
)
assert_equal
0
,
polymorphic
.
class
.
count
end
private
private
def
get_featureful_model
def
get_featureful_model
FeaturefulModel
.
new
(
:name
=>
"not empty"
)
FeaturefulModel
.
new
(
:name
=>
"not empty"
)
...
...
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