Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename the draft method to save_draft for clarity #8693

Merged
merged 2 commits into from
Oct 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/models/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ def self.new_note(params)
comment: 2,
type: 'note')
node.status = 4 if author.first_time_poster
node.draft if params[:draft] == "true"
node.save_draft if params[:draft] == "true"

if node.valid? # is this not triggering title uniqueness validation?
saved = true
Expand Down Expand Up @@ -1104,7 +1104,7 @@ def self.unlike(nid, user)
end

# status = 3 for draft nodes,visible to author only
def draft
def save_draft
self.status = 3
save
self
Expand Down