lazaronixon / authentication-zero

An authentication system generator for Rails applications.
MIT License
1.52k stars 48 forks source link

Do not force-override the user.account on creation #113

Open tmaier opened 3 months ago

tmaier commented 3 months ago

The user model has the following code:

  <%- if options.tenantable? %>
  before_validation on: :create do
    self.account = Account.new
  end
  <%- end -%>

I think this would lead to that the set account gets overriden. I would propose to be a bit more conservative here:

  <%- if options.tenantable? %>
  before_validation on: :create do
    self.account ||= Account.new
  end
  <%- end -%>