delayed_job_active_record | ActiveRecord backend integration for DelayedJob | Web Framework library
kandi X-RAY | delayed_job_active_record Summary
kandi X-RAY | delayed_job_active_record Summary
ActiveRecord backend integration for DelayedJob 3.0+
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of delayed_job_active_record
delayed_job_active_record Key Features
delayed_job_active_record Examples and Code Snippets
Community Discussions
Trending Discussions on delayed_job_active_record
QUESTION
I am getting the following error zeitwerk/loader/helpers.rb:95:in const_get': uninitialized constant Controllers::BasePublicDecorator (NameError)
This is an error in a local production console using rails c -e production
but not an issue in development which works perfectly.
In an engine, CcsCms::PublicTheme
, I have a decorator I am using to extend the controller of another CcsCms::Core
engine and it is this decorator that is causing the error.
...public_theme/app/decorators/decorators/controllers/base_public_decorator.rb
ANSWER
Answered 2022-Apr-02 at 19:30Problem here is that when lazy loading, nobody is referencing a constant called ...::BasePublicDecorator
. However, Zeitwerk expects that constant to be defined in that file, and the mismatch is found when eager loading.
The solution is to configure the autoloader to ignore the decorators, because you are handling their loading, and because they do not define constants after their names. This documentation has an example. It needs to be adapted to your engine, but you'll see the idea.
For completeness, let me also explain that in Zeitwerk, eager loading is a recursive const_get
, not a recursive require
. This is to guarantee that if you access the constant, loading succeeds or fails consistently in both modes (and it is also a tad more efficient). Recursive const_get
still issues require
calls via Module#autoload
, and if you ran one for some file idempotence also applies, but Zeitwerk detects the expected constant is not defined anyway, which is an error condition.
QUESTION
So I have a file not found problem. I have an engine that works in development mode in the engines test/dummy app, the engine allows the editing of sass variables and stores them in a theme table, the variables are used by a sass partial such as _banner.scss containing variables used in the main stylesheet such as $banner_color which is then imported into the main stylesheet which in turn is precompiled using an initializer in the engine.rb file and inclusion in the app/config/engine_name_manifest.js.
The files are all available in development with the local dummy app but not in the eventual host app due to the assets being compiled.
I have a rake task that takes the data, updates the relevant partial e.g. _banner.scss with the data from the theme table but of course the partials are not not available in a host app as the engine has already compiled them. I'm looking for a solution that will allow me to edit the raw, uncompiled stylesheets then recompile them. Obviously my Capistrano deploy script will need to reapply the stylesheet changes every deployment but that is just a rake task call. What approach should I take? Should I find a way to copy the css files to the host app in an engine initializer? Should I use a different approach entirely, I have started looking at propshaft but that is a massive step to replace sass rails and I'm not sure how that would help
The engine
...ANSWER
Answered 2022-Apr-02 at 03:44Thanks for clarifying. If I understood correctly here my take on it.
partials are not not available in a host app as the engine has already compiled them
Partials are still there, precompilation just outputs *.{css/js}
files into public/assets/
that are declared in app/assets/config/manifest.js
.
To get to engines files, instead of Rails.root
use:
QUESTION
I grew an interest in contributing to Rails after watching Eileen's Talk. To make things easier, I forked the repo and I opened it in Github Codespaces. After running bundle install
, I wanted to run some tests but I kept getting this error:
ANSWER
Answered 2022-Jan-11 at 11:21According to the Rails core team member Rafael França:
This “error” is just a warning. It should not impact the setup, and you can just ignore it.
QUESTION
I’m attempting to upgrade from Rails 5.2 -> Rails 6.1. I’ve gotten all the dependencies sorted out, but am now running into an issue where my unit tests are failing because the tests do not seem to be able to create new records in our test sqlite3 1.4 DB.
Dependency Versions Updates:
...ANSWER
Answered 2021-Nov-11 at 17:23The issue ended up being a problem with our use of the protected_attributes_continued
gem
https://github.com/westonganger/protected_attributes_continued/pull/18
Upgrading protected_attributes_continued
from 1.5 -> 1.6 fixed the issue
QUESTION
In our project we are your sendgrid to send emails and delayed job for queue purpose, I upgraded ruby to 2.7 ,rails to 6.0.3.6, delayed_job_active_record to 4.1.6 . After upgrading we are noticing out of memory in aws container. Wanted to know whether it is because of memory leak. If it is because of memory leak what profiler I need to use to determine memory leak?
...ANSWER
Answered 2021-Jul-14 at 07:02Debugging this won't be an easy task. I usually use rack-mini-profiler to get the job done, which can be either easy or complicated.
There is a very helpful video from this year's Rails Conf (2021) called Profiling to make your Rails app faster - Gannon McGibbon which shows how to use that gem.
QUESTION
I have a relatively new Rails 6 app (Rails 6.1.3.1), so there's not a whole lot of customization yet. However, I cannot get session variables to persist.
For example, if I put something like the following in a controller action:
...ANSWER
Answered 2021-Jul-15 at 06:00Ok, found the problem. Turns out that I had copied the setting config.session_store :cache_store
in development.rb
from a different project I had been working on. However, this setting was added as part of the StimulusReflex setup for that other project.
From the StimulusReflex docs:
Cookie-based session storage is not currently supported by StimulusReflex.
Instead, we enable caching in the development environment so that we can assign our user session data to be managed by the cache store.
The default setting for this option is cookie_store
. By changing it to :cache_store
without specifying a cache repo, it implements ActionDispatch::Session::CacheStore and defaults to storing it in Rails.cache
, which uses the :file_store
option, which dumps it in tmp/cache
.
However, further down in development.rb
, there is some conditional logic that assigns config.cache_store
to :null_store
if there is no caching-dev.txt
file. This implements ActiveSupport::Cache::NullStore, which is "a cache store implementation which doesn't actually store anything."
So because I had not enabled caching with rails dev:cache
for this project, the session cache was getting toasted with every request.
LESSON LEARNED: Be very careful when copying config settings from an old project to a new one!
QUESTION
I am getting an error trying to run Spree 3.3 after following the steps to upgrade from 3.2 at https://guides.spreecommerce.org/developer/upgrades/three-dot-two-to-three-dot-three.html.
I updated the Gemfile, ran bundle update
, and then installed the migrations. I couldn't even run the migrations because of this same error:
ANSWER
Answered 2020-Aug-11 at 16:47For anyone else bumping into this, the multi_fetch_fragments
gem has been merged into rails 5
itself and so the line
QUESTION
I'm trying to deploy my Rails 5.0 on heroku after a bundle update. I'm blocked by an issue on assets:precompile
...ANSWER
Answered 2020-Jun-30 at 09:08Thanks to @Les Nightingill, I found the issue.
It was not directly linked to assets generation, but the probleme was indicated at the first error line in the logs :
QUESTION
I have a Rails (5.2.3) application to which I'm trying to add a chat feature so the users can communicate with each other. I have not fully implemented the feature, as I am trying to write tests as I go (if I don't know how to write tests for what I'm trying to test, I often do it this way). So far, I have two regions of the relevant page of the application laid out in HTML for the sending and reception of chat messages, JavaScript that runs the rest of the page, JavaScript that is intended to run on page load that makes the regions for the chat feature fill out the correct space of the page, JavaScript that listens to the textarea
for chats to send, and JavaScript that listens for broadcast chats. The relevant test mimics what I can do at the moment in the development version: type text in the sending </code>, hit return, and see the message in the
that holds the chats. The development logs show that the message hits the redis server and are forwarded as expected.
The chat tool test fails. If I open the console in the browser running the tests, I see neither errors nor evidence that the JavaScript on the page is executed for this test (all of the other tests, all of which are tagged @javascript
execute correctly). If I add enough of a delay, I can see that both of the methods I've employed to send the enter
key to the textarea
appear to work (in that the cursor moves), but the expected behavior on the page (that the text is sent to the redis server for broadcast) doesn't occur.
There's no evidence in the test log that the ActionCable server fires up. I have capybara-chromedriver-logger
installed, but I see no evidence of the logging I would expect.
If there is information missing from my question that you think would be helpful in answering it, please ask.
The CoffeeScript I've written for the chat elements (which executes in development, but not in the test):
...
ANSWER
Answered 2020-Feb-20 at 20:03Generally one would use the async
actioncable adapter when testing (not the redis
adapter) and you'd need to configure actioncable to run in app (in the test environment) - https://guides.rubyonrails.org/action_cable_overview.html#in-app - in order for it to start up when Capybara starts the application.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install delayed_job_active_record
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page