comfy/comfy-blog

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

tyrant opened this issue · 0 comments

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