Closed renatamarques97 closed 4 years ago
I think we don't need to deal with multiple rails versions because it's only the fallback that we automaticaly set and Knock users can change it in the config/knock.rb
file into their own applications. Then, I think the solution provided here, won't work if an user sets an empty string in that file... Can you confirm it, please?
My suggestion is to transform the mattr_accessor
into mattr_writer
+ a class getter method, that will handle empty strings to raise that error. I would leave it raise NoMethodError
in older versions were Rails.application.secrets
doesn't exist, and user can fix that changing for the more appropriated value...
Also, I suggest to create a specific error class for that empty string exception as well...
Last, please, add some test to that 👍
Thanks for clarifying me
resolves #212
@andrerpbts let me know how to deal with multiple rails versions