Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
b98b5c828f6a
Commit
a74a69db
authored
Feb 18, 2016
by
Douglas Barbosa Alexandre
Browse files
Use destroy, in case we ever have before_destroy callbacks on Task
parent
ba0bb170d633
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/models/note.rb
View file @
b98b5c82
...
...
@@ -37,7 +37,7 @@ class Note < ActiveRecord::Base
belongs_to
:author
,
class_name:
"User"
belongs_to
:updated_by
,
class_name:
"User"
has_many
:tasks
,
dependent: :de
lete_all
has_many
:tasks
,
dependent: :de
stroy
delegate
:name
,
to: :project
,
prefix:
true
delegate
:name
,
:email
,
to: :author
,
prefix:
true
...
...
spec/models/note_spec.rb
View file @
b98b5c82
...
...
@@ -27,7 +27,7 @@
it
{
is_expected
.
to
belong_to
(
:noteable
)
}
it
{
is_expected
.
to
belong_to
(
:author
).
class_name
(
'User'
)
}
it
{
is_expected
.
to
have_many
(
:tasks
).
dependent
(
:de
lete_all
)
}
it
{
is_expected
.
to
have_many
(
:tasks
).
dependent
(
:de
stroy
)
}
end
describe
'validation'
do
...
...
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