Hello I appear to be having a similar, although perhaps slightly different issue, to this open issue. Here's some information, let me know if you need anything else. Thank you all for your time on this great gem!
My Ruby version: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
My Rails version: rails (7.0.3.1)
My Acts as Tenant gem version: acts_as_tenant (0.5.1)
class User < ApplicationRecord
devise :database_authenticatable, :registerable, :confirmable,
:recoverable, :rememberable, :validatable,
:lockable, :timeoutable, :trackable
acts_as_tenant(:organization)
validates :username, presence: true
validates_uniqueness_to_tenant :email, :username
end
With the code how it is, specifically the line in user.rb validates_uniqueness_to_tenant :email, :username running any rails db:* command causes an immediate error with Acts as Tenant Gem, backtrace follows:
But, if I change the line to validates_uniqueness_to_tenant :email or validates_uniqueness_to_tenant :username all rails db:* commands work correctly and as expected.
Hello I appear to be having a similar, although perhaps slightly different issue, to this open issue. Here's some information, let me know if you need anything else. Thank you all for your time on this great gem!
My Ruby version:
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
My Rails version:rails (7.0.3.1)
My Acts as Tenant gem version:acts_as_tenant (0.5.1)
My organization.rb (my tenant model):
My user.rb (from Devise):
With the code how it is, specifically the line in user.rb
validates_uniqueness_to_tenant :email, :username
running anyrails db:*
command causes an immediate error with Acts as Tenant Gem, backtrace follows:But, if I change the line to
validates_uniqueness_to_tenant :email
orvalidates_uniqueness_to_tenant :username
allrails db:*
commands work correctly and as expected.