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

Updating post time to published time #7511

Closed
wants to merge 5 commits into from
Closed
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
5 changes: 3 additions & 2 deletions app/controllers/notes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,9 @@ def publish_draft
if current_user && current_user.uid == @node.uid || current_user.can_moderate? || @node.has_tag("with:#{current_user.username}")
@node.path = @node.generate_path
@node.slug = @node.slug.split('token').first
@node['created'] = DateTime.now.to_i # odd assignment needed due to legacy Drupal column types
@node['changed'] = DateTime.now.to_i
# changing date of post to present date
@node.created = DateTime.now.to_i
@node.changed = DateTime.now.to_i
@node.publish
SubscriptionMailer.notify_node_creation(@node).deliver_now
flash[:notice] = "Thanks for your contribution. Research note published! Now, it's visible publicly."
Expand Down