How to include Concern inside DeviseMailer - strange name_error
I'm using engines inside my Rails 7 app. I've got Core engine where I can find a devise mailer (from devise_invitable gem). Think there is only 1 Devise application mailer possible, and I don't need a...
View ArticleIs there a solution to bypass 'can't add a new key into hash during iteration...
I have a big problem with the expected RuntimeError: "can't add a new key into hash during iteration"In my case a I have a YAML file: test.yaml - in which I have some keys already...
View ArticleIs there a way to skip 2FA while using fastlane spaceship app analytics?
I want to show AppStoreConnect's app analytics in my web app. Using fastlane/spaceship(fastlane gem) to get metrics from AppStoreConnect. Unbale to proceed due to 2FA. I just want to skip the 2FA which...
View ArticleHow to change Shopify tax calculation to use the billing address instead of...
I am trying to adjust the tax calculation in my Shopify shop so that it is based on the customer's billing address and not their shipping address. I have tried modifying the Liquid templates, but it...
View ArticleIs it possible to add custom data in meta in papertrail only in the 'create'...
has_paper_trail meta:{ object: 'custom_data' }this is my code need to have a condition where we add meta only in case of createi tried this has_paper_trail meta: { object: ->{ instance.new_record?...
View ArticleCan we put regex string in enviroment variable?
I have code in rails to check CORS from list of domain in env like thisconfig.middleware.insert_before 0, Rack::Cors do domains = "" if ENV["DOMAIN_CORS"].present? && !ENV["DOMAIN_CORS"].empty?...
View ArticleLine break in Twilio
I'm trying to format my Twilio SMS via ruby to have line breaks so I can send an SMS like so:"Please enter your order as such: - 3 beers - 2 glasses of red wine"I've seen suggestions like use \n for...
View ArticleUse parent values in subquery
I have a problem.How can I use a parent attribute in a subquery select?ExampleRecord Aid: 1parent_id: 1name: Test ARecord Bid: 2parent_id: 1name: Test BRecord cid: 3parent_id: 2name: Test cQuery...
View ArticleHow to sort a hash by values
I was trying to sort a particular hash by values. I came across a way using the method sort_by. But even though I call sort_by on a hash, it returns an array, i.e.:a = {}a[0] = "c"a[1] = "b"a[2] =...
View ArticleHow do I convert a Ruby hash string into a JSON string using Python?
I need to convert a string like:{:old_id=>{:id=>"12345", :create_date=>Mon, 15 May 2023, :amount=>50.0}, :new_id=>{:id=>nil, :create_date=>"2023-05-15", :amount=>"50.00"}}into a...
View ArticleWhere and when to use Lambda?
I am trying to understand why do we really need lambda or proc in ruby (or any other language for that matter)?#methoddef add a,b c = a+bend#using procdef add_proc a,b f = Proc.new {|x,y| x + y }...
View ArticleCoercion error when passing Boolean argument in graphql-ruby mutation query
I have a simple graphql-ruby mutation:class Mutations::User::Destroy < Mutations::BaseMutation argument :confirm, GraphQL::Types::Boolean, required: true payload_type GraphQL::Types::Boolean def...
View ArticleHow to suppress Rails console/irb outputs
I was testing some DB entries in our production server in Rails Console where almost all the commands were producing a huge number of lines of output and causing the ssh channel to hang.Is there a way...
View Articlehow to resolve pending migration error in rails 7
I have created a migration in which i mistakenly duplicate the columns of "created_at" , now my screen is displaying this error, after when i remove the duplication, the errror was also same before...
View ArticleHow to deal with `RuboCop::Cop::Rails::LexicallyScopedActionFilter ` when...
I have a class similar to this:class UsersController < ApplicationController before_action :user_authentication, except: :create include CrudendRubocop Rails complains, "create is not explicitly...
View Articleruby on rails add a column after a specific column name
I tried to add a column to a table after a specific column in the table.Here is what I did:rails generate migration add_reaction_id_to_patient_allergies reaction_id: integer :after =>...
View ArticleRuby variable name with double underscores
Sometimes I see variable names with double underscore in the beginning and the end. For example:Article.__elasticsearch__Is there some naming convention related to double underscores in Ruby variable...
View ArticleDelay dialing agents until after the Say prompt completes for queued callers
I'd love some advice on my Twilio setup for a problem I'm trying to solve.I want to place incoming calls on hold before routing to an available agent. Calls are routed to agents one at a time and are...
View ArticleUsing a Private Github Homebrew Tap to distribute a tool in a Private...
I'm build an internal tool for use at my company. The tool is written in python and uses poetry for dependency management. I'd like to use brew for distributing the tool to anyone at the company, where...
View ArticleHow do I inspect the full URL generated by HTTParty?
I want to look at the full URL the HTTParty gem has constructed from my parameters, either before or after it is submitted, it doesn’t matter.I would also be happy grabbing this from the response...
View Article