i'm attempting to do some tests in RoR (ruby v2.6.8, rails v6.1.5): I want to create a devise based on an existing database with existing user table (called Account, with capitalized A). I managed to execute the first steps to migrate the columns needed by Devise but i get stuck when i try to signup:
undefined method `email' for #<Account:0x0000000110cb34f8>
Did you mean? Email
Email=
Email?
Extracted source (around line #469):
else
match = matched_attribute_method(method.to_s)
match ? attribute_missing(match, *args, &block) : super
end
end
ruby2_keywords(:method_missing) if respond_to?(:ruby2_keywords, true)
Any general suggestion how to handle this and possible future problems? Thanks a lot
1条答案
按热度按时间ubof19bj1#
The simplest solution is
alias_attribute
.That will delegate the
:email
and:email=
methods to:Email
and:Email=
respectively