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

Surpress warnings for missing SolidQueue tables #417

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

scarroll32
Copy link
Contributor

The new SolidQueue namespaced tables are causing warnings if they don't exist. This PR supressess the warnings, and is a follow-on to #390

Example

❯ rake immersive:erd:events
erd --only 'Community,Event,EventRound,EventRegistration,User,EventGroup,EventGroupMember,EventMemberEvaluation' --notation bachman --attributes foreign_keys,content --title false --orientation=horizontal --filename=docs/technical/erds/events --inheritance --open
Loading application in 'immersive-app'...
Tried to load your application environment from '/Users/sean/immersive/immersive-app/config/environment.rb' but the file was not present.
This means that your models might not get loaded fully when the diagram gets built. This can
make your entity diagram incomplete.

However, if you are using ActiveRecord without Rails just make sure your models get
loaded eagerly before we generate the ERD (for example, explicitly require your application
bootstrap file before calling rails-erd from your Rakefile). We will continue without loading the environment file,
and recommend you check your diagram for missing models after it gets generated.
Generating entity-relationship diagram for 35 models...
Warning: Ignoring invalid model SolidCable::Message (table solid_cable_messages does not exist)
Warning: Ignoring invalid model SolidCache::Entry (table solid_cache_entries does not exist)
Warning: Ignoring invalid model SolidQueue::Semaphore (table solid_queue_semaphores does not exist)
Warning: Ignoring invalid model SolidQueue::RecurringTask (table solid_queue_recurring_tasks does not exist)
Warning: Ignoring invalid model SolidQueue::Process (table solid_queue_processes does not exist)
Warning: Ignoring invalid model SolidQueue::Pause (table solid_queue_pauses does not exist)
Warning: Ignoring invalid model SolidQueue::Job (table solid_queue_jobs does not exist)
Warning: Ignoring invalid model SolidQueue::ScheduledExecution (table solid_queue_scheduled_executions does not exist)
Warning: Ignoring invalid model SolidQueue::RecurringExecution (table solid_queue_recurring_executions does not exist)
Warning: Ignoring invalid model SolidQueue::ReadyExecution (table solid_queue_ready_executions does not exist)
Warning: Ignoring invalid model SolidQueue::FailedExecution (table solid_queue_failed_executions does not exist)
Warning: Ignoring invalid model SolidQueue::ClaimedExecution (table solid_queue_claimed_executions does not exist)
Warning: Ignoring invalid model SolidQueue::BlockedExecution (table solid_queue_blocked_executions does not exist)
Warning: Ignoring invalid association :job on SolidQueue::Execution (model SolidQueue::Job exists, but is not included in domain)
Warning: Ignoring invalid association :invited_by on User (polymorphic interface InvitedBy does not exist)
Diagram saved to 'docs/technical/erds/events.pdf'.

@scarroll32
Copy link
Contributor Author

This is failing but I think this PR will fix the problem #414

❯ rake immersive:erd:events
erd --only 'Community,Event,EventRound,EventRegistration,User,EventGroup,EventGroupMember,EventMemberEvaluation' --notation bachman --attributes foreign_keys,content --title false --orientation=horizontal --filename=docs/technical/erds/events --inheritance --open
/Users/sean/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/bundler/gems/rails-erd-ecb89c33669d/lib/rails_erd/cli.rb:167:in `initialize': undefined method `generator' for an instance of Hash (NoMethodError)

      require "rails_erd/diagram/graphviz" if options.generator == :graphviz
                                                     ^^^^^^^^^^
	from /Users/sean/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/bundler/gems/rails-erd-ecb89c33669d/lib/rails_erd/cli.rb:161:in `new'
	from /Users/sean/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/bundler/gems/rails-erd-ecb89c33669d/lib/rails_erd/cli.rb:161:in `start'
	from /Users/sean/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/bundler/gems/rails-erd-ecb89c33669d/bin/erd:4:in `<top (required)>'
	from /Users/sean/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/bin/erd:25:in `load'
	from /Users/sean/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/bin/erd:25:in `<main>'
rake aborted!
Command failed with status (1): [erd --only 'Community,Event,EventRound,EventRegistration,User,EventGroup,EventGroupMember,EventMemberEvaluation' --notation bachman --attributes foreign_keys,content --title false --orientation=horizontal --filename=docs/technical/erds/events --inheritance --open]
/Users/sean/immersive/immersive-app/lib/tasks/erd.rake:4:in `create_erd'
/Users/sean/immersive/immersive-app/lib/tasks/erd.rake:12:in `block (3 levels) in <main>'
Tasks: TOP => immersive:erd:events
(See full trace by running task with --trace)

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

Successfully merging this pull request may close these issues.

1 participant