mbleigh / acts-as-taggable-on

A tagging plugin for Rails applications that allows for custom tagging along dynamic contexts.
http://mbleigh.lighthouseapp.com/projects/10116-acts-as-taggable-on
MIT License
4.96k stars 1.2k forks source link

undefined method `[]=' for nil:NilClass in rails 6.1 application. #1020

Closed ghost closed 3 years ago

ghost commented 3 years ago

Bug occurs using acts-as-taggable-on ver. 6.0 in rails6.1 application when creating the data which has an association(s) with tag(s). ( the bug is undefined method[]=' for nil:NilClass` ).

I investigated the reason why the bug occurred. I set up a simple hypothesis, which are related with a version of acts-as-taggable-on, solve this problem.

As a result, to the bug fix, change the Gemfile as follows;

gem 'acts-as-taggable-on', '~> 7.0'

Although the bug can be fixed, in the README, this gem recommends ver 6.0 without User's rails application version.

So, I think the gem file description also modified correctly like this.

gem 'acts-as-taggable-on', '~> 6.0'

If you use rails 6.1 application, you should change the version as follows;

 gem 'acts-as-taggable-on', '~> 7.0'

Please consider my proposal.