Eric Gross
06/01/2023, 3:49 AMSabo
06/01/2023, 3:33 PMfield_container
with an attribut serialized as an Array if it's possible ?
In admin side (admin/products/:product/edit) I have
<div data-hook="admin_product_form_tags">
<%= f.label :tags %>
<%= f.field_container :tags do %>
<%= f.text_field :tags, class: 'fullwidth title', multiple: true %>
<% end %>
</div>
Technically it's working, but I get something like ["tag1 tag2 tag3"]
where I would have something like ["tag1", "tag2", "tag3"]
Ben
06/03/2023, 1:55 PMloic
06/05/2023, 10:22 AMloic
06/05/2023, 10:22 AMloic
06/05/2023, 10:24 AMSteven Chao
06/05/2023, 2:54 PMEric Gross
06/05/2023, 6:58 PM_Spree_::_Ability_.register_ability
with new abilities. In my case though I don't want to create more abilities, but I want to indicate that any user with .has_role?(:admin)
should be considered an admin by the Soldius back end. I haven't figured out how to make that work, has anyone got it working? I'm using pundit
in my app rather than cancancan
.Eric Gross
06/05/2023, 11:03 PMclass_eval
that i suspect i can replace with a cleaner prepended situation, but i'm not sure how ... my current code is
Spree::Base.class_eval do
before_create :associate_tenant
class TenantNotFound < StandardError; end
def associate_tenant
return logger.warn("Ingoring setting tenant") if RLS.disabled?
raise(TenantNotFound, "RLS.current_tenant is not set") unless RLS.current_tenant
self.tenant_id = RLS.current_tenant_id
<http://logger.info|logger.info>("Set thread for #{self.class.name}")
end
end
is there an obvious way to replace this evaluated callback creation with one that would prepend the callback instead?Cody Baldwin
06/06/2023, 12:41 AMUlysses
06/06/2023, 2:47 PMEric Gross
06/09/2023, 7:36 PM<% if spree.respond_to? :root_path %>
<li data-hook="store-frontend-link">
<%= link_to spree.root_path, target: '_blank' do %>
<i class='fa fa-external-link'></i>
<%= t('spree.back_to_store') %>
<% end %>
</li>
<% end %>
and it's kicking off
Failures:
1) Dashboard access when accessing the Solidus dashboard with access will go to the dashboard
Failure/Error:
def #{method}(*args)
options = args.extract_options!
options = url_options.merge((options || {}).symbolize_keys)
if @script_namer
options[:script_name] = merge_script_names(
options[:script_name],
@script_namer.call(options)
)
end
ActionView::Template::Error:
undefined method `root_path' for #<Module:0x000000010c98d700>
[Screenshot Image]: /Users/eric/dev/slipwise/mos/tmp/capybara/failures_r_spec_example_groups_dashboard_access_when_accessing_the_solidus_dashboard_with_access_will_go_to_the_dashboard_498.png
# /Users/eric/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/actionpack-7.0.5/lib/action_dispatch/routing/routes_proxy.rb:45:in `root_path'
# /Users/eric/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/solidus_backend-4.0.0/app/views/spree/admin/shared/_navigation_footer_fallback.html.erb:33:in `___sers_eric__asdf_installs_ruby_______lib_ruby_gems_______gems_solidus_backend_______app_views_spree_admin_shared__navigation_footer_fallback_html_erb___4161283517603043021_318580'
# /Users/eric/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/actionview-7.0.5/lib/action_view/base.rb:244:in `public_send'
# /Users/eric/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/actionview-7.0.5/lib/action_view/base.rb:244:in `_run'
via this spec
context "when accessing the Solidus dashboard" do
describe "with access" do
let(:admin) { create(:account, :admin) }
it "will go to the dashboard" do
passwordless_sign_in(admin)
visit spree.admin_path
expect(page).to have_css "li", exact_text: "Orders"
end
end
end
i gather that it is expected that i don't have a spree.root_path
because i am not using the front-end, only core & the back-end. i am happy to add spree.root_path
if anyone knows how, or does anyone have any ideas without having to edit the template?Given Reed
06/13/2023, 12:33 PMspree.rb
, set up the association with the new address to the order, all the new fields show up just like I want them to.
The fun comes from the client wanting to move one of the new fields to a different section in the checkout. It worked perfectly when it was in the address step, but they want it all the way out on the confirm step. I've got some code in the update method of checkouts_controller.rb
that logs out the value I want, has everything I need, but when I try to save the value (still associated with the address for now) I get:
ActiveRecord::ReadOnlyRecord in CheckoutsController#update
Spree::Address is marked as readonly
The code I'm trying to use is:
@order.sub_address.lockbox_code = params['order']['checkout_confirm_attributes']['lockbox_code']
@order.save!
I've also tried instantiating a Spree::Address model specifically to update it directly instead of through the relationships, in case that made a difference, but it gave the same result.
I saw this but that looks like how the controller is doing it now:
Spree::OrderUpdateAttributes.new(@order, update_params, request_env: request.headers.env).apply
but while I work on that I was wondering if I was just taking the wrong approach entirely 😛Eric Gross
06/13/2023, 12:59 PMInsufficient stock for order
- how can I prevent that?Eric Gross
06/13/2023, 1:28 PMTom Wilson
06/13/2023, 2:35 PMsolidus-contrib/solidus_product_assembly
? I've been trying to make that gem support Solidus 4, but my latest attempt is failing in the Circle specs in ways that don't seem to be related to the code itself, but rather some configuration. (Either that I don't have access to actually trigger the builds correctly, or else there's some Circle configuration that needs to be tweaked)Tom Wilson
06/13/2023, 2:35 PMEric Gross
06/13/2023, 4:05 PMm marquesini
06/13/2023, 8:30 PMm marquesini
06/13/2023, 9:21 PMgerardo ternero silva
06/14/2023, 5:23 PMgerardo ternero silva
06/14/2023, 5:28 PMTyler Kocheff
06/14/2023, 10:18 PMSpree::CreditCard
, but I can't get the table in the database to populate during checkout, or even from the console when doing Spree::CreditCard.create()
. I have tried adding to permitted_credit_card_update_attributes
and just about every other possible permitted attribute I could think of. There is no error that I can find. Am I missing somewhere?Eric Gross
06/14/2023, 10:51 PMroutes.rb
file and i see the line
get '/checkout/:state', to: 'checkouts#edit', as: :checkout_state
but looking at the CheckoutsController
and its superclass CheckoutBaseController
and its superclass StoreController
.. and on, i don't see a def edit
so i can't figure out where this is defined.Steve Simitzis
06/15/2023, 1:33 AMTom Wilson
06/16/2023, 2:29 PMsolidus_support 0.9.3
, I'm running into errors I can't fully explain. Our CI system is running bundle exec rake db:reset
and it fails to find the Spree::Admin::UserSessionsController
. I'm suspecting that something doesn't play nicely between the change to autoloading here and the structure of the solidus_auth_devise
library.Tom Wilson
06/16/2023, 2:31 PMsolidus_support 0.9.3
and solidus_auth_devise 2.5.8
Eric Gross
06/16/2023, 8:23 PMEric Gross
06/16/2023, 9:30 PMconfig/solidus_stripe.rb
Spree::Config.static_model_preferences.add(
"SolidusStripe::PaymentMethod",
"solidus_stripe_env_credentials",
api_key: Rails.application.credentials.stripe.api_key!,
publishable_key: Rails.application.credentials.stripe.publishable_key!,
test_mode: Rails.application.credentials.stripe.api_key!.start_with?("sk_test_"),
webhook_endpoint_signing_secret: Rails.application.credentials.stripe.webhook_signing_secret!,
)
for some reason in app/views/orders/payment_info/_stripe.html.erb
,
stripe_payment_method = payment.source.stripe_payment_method
# <https://stripe.com/docs/api/payment_methods/object#payment_method_object-type>
partial_base = "checkouts/existing_payment/stripe"
payment_type = stripe_payment_method.type
isn't working because stripe_payment_method
is nil.Eric Gross
06/18/2023, 10:23 PMcheckout_path
, it goes all the way through to the summary step, but it does show the payment tab at the top - and it does show a positive total amount. when i select the payment tab, i am able to pay, then it goes back to the confirm step, and then i can complete the checkout flow.
why would my checkout flow be passing through the payment step when a payment is required?