Writing a test for my project and notification of this warning about its end when rspec starts
DEPRECATION WARNING: Passing the separator argument as a positional parameter is deprecated and will soon be removed. Use `separator: '-'` instead. (called from add_link at /myapp/app/models/post.rb:37)
I have an action before recording a save, it looks like
self.link = theme + '-' + Time.now.to_formatted_s(:number)
And I tried to find some information about this, but I really don't understand what this warning means.
** EDIT **
Well, I changed to "#{theme}-#{Time.now.to_formatted_s(:number)}" , but it still gives me the same warning.
Than I decided to go the other way and changed to "#{theme}(#{date})" . The date method is as follows:
date = [Time.now.day, Time.now.month, Time.now.year] date = date.join('-') date
But that still gives me an error.
I do not think that this is really a big problem, but still I want to understand why this is happening.
** EDIT **
Explain this, it should fix that I am using the cause of this problem (the gem is called the_string_to_slug ). I will do further research to fix this warning with a gem, or I will try to find a way to replace it.
ruby ruby-on-rails
Andrey Drozdov
source share