Question

I am using a gem devise_invitable. I just want to re-invite an user. However, for such a simple operation I got an error:

[10] pry(#<MyController>)> @user = User.invite!("user1@test.com", current_user)
NoMethodError: undefined method `with_indifferent_access' for "user1@test.com":String
from /home/alex/.rvm/gems/ruby-2.1.1/gems/devise_invitable-1.3.3/lib/devise_invitable/model.rb:252:in `invite!'

I tried to include the 2 files that might solve this but I couldn't because they didn't exist:

[11] pry(#<MyController>)> require 'active_support/core_ext/hash'
=> false

[13] pry(#<MyController>)> require 'active_support/core_ext/hash/indifferent_access'
=> false
Was it helpful?

Solution

It should be:

@user = User.invite!({email: "user1@test.com"}, current_user)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top