Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validates_uniqueness_to_tenant breaks the creation of the DB #254

Open
Elmolesto opened this issue Mar 3, 2021 · 1 comment
Open

validates_uniqueness_to_tenant breaks the creation of the DB #254

Elmolesto opened this issue Mar 3, 2021 · 1 comment

Comments

@Elmolesto
Copy link

I've dropped my DB and then when i try to run rails db:create i got this error:

ActiveRecord::NoDatabaseError: FATAL: database "safetypanel_development" does not exist
/Users/felipehernandez/code/safetypanel/app/models/user.rb:19:in `class:User'

In User.rb:19:
validates_uniqueness_to_tenant :dni

To solve the issue I've to comment out that line and then i've run rails db:create withut errors.

@ybakos
Copy link

ybakos commented Mar 14, 2021

@Elmolesto Could you share the version of Rails you are using, and in user.rb, can you show the first 19 lines?
Does User acts_as_tenant to another model, and does that declaration come before validates_uniqueness_to_tenant ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants