Given Reed
11/05/2021, 5:45 PMChris
11/09/2021, 12:55 PMjakemumu
11/10/2021, 4:53 PMNazim-Yoldas
11/13/2021, 12:54 AMbin/rails s
, it's giving me an error where it states that the db doesn't exist.
More precisely: FATAL: database "Near_Moi_development" does not exist (ActiveRecord::NoDatabaseError)
I've tried db:create.all, db:setup, but to no availDenys Medynskyi
11/16/2021, 10:15 AMclass ApplicationController < ActionController::Base
set_current_tenant_through_filter # Required to opt into this behavior
before_action :set_customer_as_tenant
def set_customer_as_tenant
customer = Customer.find(session[:current_customer_id])
set_current_tenant(customer)
end
end
Do you know what is the preferable way to do this?
or simply define Spree::SomeBaseController
and add filtration in any way I want 🤔Denys Medynskyi
11/16/2021, 10:19 AM/store/admin
for each tenantLandon Lapensee
11/17/2021, 5:03 AMurl_for
command in the product model. Essentially I want to be able to call generate_qr
on a product instance and get the url for each product to display it in the admin panel. In the attached image you can see the error message I get when trying to access the product controller. The closest information I could get about the problem was this:
” Its a spree app and the controller was inherited from Spree::BaseController. url_for only sees routes within the spree engine and not globals
Fixed the issue by adding main_app to url_for `main_app.url_for(...)`”
I used this main_app method but got the following error message:
undefined local variable or method `main_app' for #<Spree::Product:0x00007f85ba80fb28>
Does anybody have any insight on how to tackle this problem?Given Reed
11/17/2021, 4:36 PMTyler Kocheff
11/17/2021, 5:01 PMSpree::Product.new(data_goes_here).save
It returns nil
. From the SQL in the rails console it looks like INSERT INTO "spree_products"
, INSERT INTO "spree_variants"
, INSERT INTO "spree_prices"
are successful, and then I see this:
Spree::StockLocation Load (0.3ms) SELECT "spree_stock_locations".* FROM "spree_stock_locations" WHERE "spree_stock_locations"."propagate_all_variants" = $1 [["propagate_all_variants", true]]
Spree::StockItem Exists? (0.8ms) SELECT 1 AS one FROM "spree_stock_items" WHERE "spree_stock_items"."variant_id" = $1 AND "spree_stock_items"."deleted_at" IS NULL AND "spree_stock_items"."stock_location_id" = $2 AND "spree_stock_items"."deleted_at" IS NULL LIMIT $3 [["variant_id", 850], ["stock_location_id", 1], ["LIMIT", 1]]
TRANSACTION (0.5ms) ROLLBACK
The stock location from the ID in the params exists.
The difficult part is that Spree::Product.new().errors
is blank and thus the error in the UI is also blank when the flash errors div appears in the admin UI. Any thoughts or things I may be missing? This store is set not to track inventory in config/initializers/spree.rb
via `config.track_inventory_levels = false`but I tried switching that to true and still getting the same.
The only change to products I made was adding a handling_charge
boolean via migration a while back and giving that a spot in the UI, but I swear this was working after that. I have Spree::PermittedAttributes.product_attributes << :handling_charge
in config/initializers/spree.rb
Given Reed
11/17/2021, 8:13 PMbundle
after adding braintree (https://github.com/solidusio/solidus_paypal_braintree) to the gemfile throws an error.
Attempting to run the gem install
from the error message also fails. Is there a known way to get braintree installed?Alexander
11/18/2021, 12:42 PMvictor
11/22/2021, 1:38 PMvictor
11/22/2021, 1:38 PMjakemumu
11/22/2021, 11:01 PMjakemumu
11/22/2021, 11:01 PMJared Norman
jakemumu
11/22/2021, 11:15 PM#
on the page -- so seems UJS isn't grabbing itjakemumu
11/22/2021, 11:15 PMJared Norman
jakemumu
11/22/2021, 11:25 PMjakemumu
11/22/2021, 11:25 PMvictor
11/23/2021, 2:59 PMprocessed
and analyze?
jakemumu
11/23/2021, 7:32 PMnsolidus
11/25/2021, 10:20 PMAndrew
11/29/2021, 10:11 AMSlackbot
11/29/2021, 10:48 AMAndrew
11/29/2021, 2:02 PMself.prepended(base)
The code below doesn’t seem to work
module Spree::StockItemDecorator
def self.prepended(base)
base.validates :count_on_hand, numericality: { only_integer: true }, unless: :backorderabled?
end
Spree::StockItem.prepend self
end
Given Reed
11/29/2021, 3:05 PMsmart_button_validation_error_derived_payee_transaction_mismatch_sandbox
and smart_button_validation_error_payee_no_match
in the developer console.
It's likely that it's a configuration issue on my end, but I'm using the values from the braintree dashboard. I went through the readme and didn't see any additional setup or config options, anybody have any ideas?Given Reed
11/29/2021, 9:38 PMcheck.rb
contents into my custom rb, I've inserted the new payment method into the store config, but when I try to set it up as a payment method for the store I get
Invalid single-table inheritance type: Spree::PaymentMethod::Check is not a subclass of Spree::PaymentMethod
I have tried inheriting Spree::PaymentMethod
, Spree::PaymentMethod::Check
, have tried Embold::PurchaseOrder
and Embold::PaymentMethod::PurchaseOrder
, but it seems like I'm still missing something. Do I need to build a skeleton service provider / gateway and reference it in the new payment method? Is there a controller I need to implement in addition to the model? Does the "check" payment method do weird stuff that I'm just not catching and is causing me headaches? It appears that by picking "check" I've made it hard on myself to do a search for things in the code to look for how that one is set up 😛Given Reed
12/02/2021, 3:24 PMSpree::PaymentMethod::Check
, now I want to collect a value during checkout (the po number). I can show the field, but I'm not sure how to get the value saved. I created a table to store purchase orders (purchase_orders
), I created a payment source, and I set the source to the payment method. I'm not entirely sure how to link the new table to the source / method. Is it something that should be automatic and it's all from a naming convention I botched? Do I need to specify the table name somewhere in the source? Should I try to use the existing credit cards table but without all the cc data?