Code Capsules

Joined

100 Experience
0 Lessons Completed
0 Questions Solved

Activity

Hello i have an account on hatchbox everything work fine on development but crash on PRODUCTION

i have a problem with solid_queue i think ....

Here the log :

[49fdd936-fd24-4c71-b0b1-7d766852f9cd] ActionView::Template::Error (ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "solid_queue_jobs" does not exist
LINE 10:  WHERE a.attrelid = '"solid_queue_jobs"'::regclass
                             ^
)
[49fdd936-fd24-4c71-b0b1-7d766852f9cd] Caused by: SolidQueue::Job::EnqueueError (ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "solid_queue_jobs" does not exist
LINE 10:  WHERE a.attrelid = '"solid_queue_jobs"'::regclass
                             ^
)
[49fdd936-fd24-4c71-b0b1-7d766852f9cd] Caused by: ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR:  relation "solid_queue_jobs" does not exist
LINE 10:  WHERE a.attrelid = '"solid_queue_jobs"'::regclass
                             ^
)
[49fdd936-fd24-4c71-b0b1-7d766852f9cd] Caused by: PG::UndefinedTable (ERROR:  relation "solid_queue_jobs" does not exist
LINE 10:  WHERE a.attrelid = '"solid_queue_jobs"'::regclass
                             ^
)
[49fdd936-fd24-4c71-b0b1-7d766852f9cd]
Information for: ActionView::Template::Error (ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "solid_queue_jobs" does not exist
LINE 10:  WHERE a.attrelid = '"solid_queue_jobs"'::regclass

In my development i can upload files with active_storage no problem but in production on hatchbox solid_queu crash ...

If anyone can help me ^

Thanks you

my database.yml

# PostgreSQL. Versions 9.3 and up are supported.
#
# Install the pg driver:
#   gem install pg
# On macOS with Homebrew:
#   gem install pg -- --with-pg-config=/usr/local/bin/pg_config
# On Windows:
#   gem install pg
#       Choose the win32 build.
#       Install PostgreSQL and put its /bin directory on your path.
#
# Configure Using Gemfile
# gem "pg"
#
default: &default
  adapter: postgresql
  encoding: unicode
  # For details on connection pooling, see Rails configuration guide
  # https://guides.rubyonrails.org/configuring.html#database-pooling
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>


development:
  <<: *default
  database: bodycapsules_rails_development

  # The specified database role being used to connect to PostgreSQL.
  # To create additional roles in PostgreSQL see `$ createuser --help`.
  # When left blank, PostgreSQL will use the default role. This is
  # the same name as the operating system user running Rails.
  #username: bodycapsules_rails

  # The password associated with the PostgreSQL role (username).
  #password:

  # Connect on a TCP socket. Omitted by default since the client uses a
  # domain socket that doesn't need configuration. Windows does not have
  # domain sockets, so uncomment these lines.
  #host: localhost

  # The TCP port the server listens on. Defaults to 5432.
  # If your server runs on a different port number, change accordingly.
  #port: 5432

  # Schema search path. The server defaults to $user,public
  #schema_search_path: myapp,sharedapp,public

  # Minimum log levels, in increasing order:
  #   debug5, debug4, debug3, debug2, debug1,
  #   log, notice, warning, error, fatal, and panic
  # Defaults to warning.
  #min_messages: notice

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  <<: *default
  database: bodycapsules_rails_test

# As with config/credentials.yml, you never want to store sensitive information,
# like your database password, in your source code. If your source code is
# ever seen by anyone, they now have access to your database.
#
# Instead, provide the password or a full connection URL as an environment
# variable when you boot the app. For example:
#
#   DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
#
# If the connection URL is provided in the special DATABASE_URL environment
# variable, Rails will automatically merge its configuration values on top of
# the values provided in this file. Alternatively, you can specify a connection
# URL environment variable explicitly:
#
#   production:
#     url: <%= ENV["MY_APP_DATABASE_URL"] %>
#
# Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
# for a full overview on how database connection configuration can be specified.
#
production:
  primary: &primary_production
    <<: *default
    url: <%= ENV['DATABASE_URL'] %>
    # database: bodycapsules_rails_production
    # username: bodycapsules_rails
    # password:
  cache:
    <<: *primary_production
    database: bodycapsules_rails_production_cache
    migrations_paths: db/cache_migrate
  queue:
    <<: *primary_production
    database: bodycapsules_rails_production_queue
    migrations_paths: db/queue_migrate
  cable:
    <<: *primary_production
    database: bodycapsules_rails_production_cable
    migrations_paths: db/cable_migrate

I also use a managed database on NEONDB.
Thanks you

Hy all, i have a problem with the counter_culture gem with my stimulus controller.
I have installed the gem and configured all.
I have 3 model :
Thats working fine for this relation: Category have a capsules_count column for counting how many capsules have a category

But i have a problem for counting the number of wishlist each Capsule have:

THE counter increase well in backend but in my frontend ( with stimulus ) i need to refresh the page for having the good value:

Here my models / controller and views !

CAPSULE

class Capsule < ApplicationRecord
    extend FriendlyId
    friendly_id :name, use: :slugged

    monetize :price_cents, allow_nil: true
    geocoded_by :address
    after_validation :geocode

    ACCEPTED_CONTENT_TYPES = %w[image/png image/jpeg].freeze

    has_many_attached :images

    belongs_to :user

    belongs_to :category
    counter_culture :category, touch: true

    has_many :wishlists, dependent: :destroy
    has_many :wishlisted_users, through: :wishlists, source: :user, dependent: :destroy
end

WISHLIST

class Wishlist < ApplicationRecord
  belongs_to :user
  belongs_to :capsule
  counter_culture :capsule
end

THE FRONT END

<div class="bg-white flex justify-center items-center rounded-md text-xs p-1" data-controller="wishlist-counter" data-capwishlists="<%= capsule.wishlists_count %>">
        <span data-wishlist-counter-target="text"></span>
</div>

THE STIMULUS CONTROLLER

import {Controller} from "@hotwired/stimulus"

// Connects to data-controller="wishlist-counter"
export default class extends Controller {
  static targets = ['counter', 'text'];
  connect() {
    this.textTarget.innerText = this.element.dataset.capwishlists;
  }
}

When i click in the like button the value of my wishlists_count upgrade well but i need to refresh the page for stimulus in my front end to show the exact value and i dont know why ^ ^ ?

THE wishlists_count add + 1 value well in back end but the value is not INSTANTLY refreshed in my front end (stimulus) ...

Thanks you for anyone can help me.