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

rails-red conflicts with discard gem #374

Open
alec-c4 opened this issue Jul 28, 2021 · 1 comment
Open

rails-red conflicts with discard gem #374

alec-c4 opened this issue Jul 28, 2021 · 1 comment

Comments

@alec-c4
Copy link

alec-c4 commented Jul 28, 2021

Hey!
I have model SalesPerson

class SalesPerson < ApplicationRecord
  include IdentityCache
  include Discard::Model

  validates :referral_code, uniqueness: true, presence: true
  validates :name, presence: true

  default_scope -> { kept }
end 

which is working with discard gem. Every time i try to generate erd file i see following error

Running via Spring preloader in process 76935
Loading application environment...
Loading code in search of Active Record models...
rake aborted!
Loading models failed!
Error occurred while loading application: uninitialized constant SalesPerson::Discard (NameError)
    app/models/sales_person.rb:3:in `<class:SalesPerson>'
    app/models/sales_person.rb:1:in `<main>'
<internal:/Users/alec/.rbenv/versions/3.0.2/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
<internal:/Users/alec/.rbenv/versions/3.0.2/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
-e:1:in `<main>'

Caused by:
NameError: uninitialized constant SalesPerson::Discard

How to fix it?

@mjobin-mdsol
Copy link

are you sure its related to rails-erd ? does not appear like so ...

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