Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Add ransackable associations to StoreCredit

Aleksandar Petrusheva7408ef2897a
diff --git a/core/app/models/spree/store_credit.rb b/core/app/models/spree/store_credit.rb
index d8887d9199..167480cbda 100644
--- a/core/app/models/spree/store_credit.rb
+++ b/core/app/models/spree/store_credit.rb
@@ -42,7 +42,8 @@ module Spree
extend Spree::DisplayMoney
money_methods :amount, :amount_used
- self.whitelisted_ransackable_attributes = %w[user_id created_by_id amount currency type_id store_id]
+ self.whitelisted_ransackable_attributes = %w[user_id created_by_id amount currency type_id]
+ self.whitelisted_ransackable_associations = %w[type user created_by]
def amount_remaining
amount - amount_used - amount_authorized