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

ComfyBlog on Rails 6.1 calls @post.update_attributes!, not @post.update! #88

Open
tyrant opened this issue Jan 7, 2021 · 0 comments
Open

Comments

@tyrant
Copy link

tyrant commented Jan 7, 2021

Expected behavior

When updating an existing blog post, I'm expecting the blog post's form to submit, its content to save, and to redirect back to the same form.

Actual behavior

Instead:

NoMethodError at /admin/sites/1/blog-posts/1
undefined method `update_attributes!' for #<Comfy::Blog::Post:0x00007fd0e59769c8>
Did you mean?  update_attribute

Steps to reproduce

I jumped into ComfyBlog's source ... and hit the cause pretty fast.

ComfyBlog calls Comfy::Admin::Blog::PostsController#update, and on line 38, you can see it calls @post.update_attributes!, not @post.update!.

This hasn't been a problem until Rails 6.1: before, #update_attributes! was deprecated in favour of #update!, but still present and usable. But now we've hit 6.1 and it's been removed completely. Naturally ComfyBlog is b0rking.

Though, whilst error-trawling, I also jumped into ComfyBlog's current master - and I see you've already made the fix. That's all great. I could easily just change my Gemfile to point to this repo's master instead of tag 2.0.7, but thought it'd also be useful to let you know at least one of your users is headbutting this.

System configuration

Rails version: 6.1.0
CMS version: 2.0.19
Ruby version: 2.0.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant