-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce SolidusPromotions #5805
Introduce SolidusPromotions #5805
Commits on Oct 25, 2024
-
Order Discounter: Reset current discounts after promo calculations
If we don't do this, and an in-memory order is calculated twice, we run the risk of wrong amounts. This is usually guarded against by calling `order.reset_current_discounts` in the `FriendlyPromotionDiscounter`, but the spec for the `AdjustLineItemQuantityGroups` action creates an order (calling `recalculate`) and then calls `compute_amount` with the stale discounts still on the order's line items. Anyways - After persisting adjustments, we can drop the current discounts.
Configuration menu - View commit details
-
Copy full SHA for ed71004 - Browse repository at this point
Copy the full SHA ed71004View commit details -
Add UI bits for AdjustLineItemQuantityGroups
We need to have the new action available, and we need it to have a partial.
Configuration menu - View commit details
-
Copy full SHA for 03f34fa - Browse repository at this point
Copy the full SHA 03f34faView commit details -
Leverage
PromotionAction#level
for display purposesThe previous version did not work for an action whose name does not end in either `LineItem` or `Shipment`. Luckily we now have the `:level` method.
Configuration menu - View commit details
-
Copy full SHA for 6827510 - Browse repository at this point
Copy the full SHA 6827510View commit details -
Add AdjustLineItemQuantityGroups to promotion map
Easy upgrades are good!
Configuration menu - View commit details
-
Copy full SHA for 53b2ea6 - Browse repository at this point
Copy the full SHA 53b2ea6View commit details -
We've refactored `call` out of the subject, but this PR did not know about that.
Configuration menu - View commit details
-
Copy full SHA for 64e270a - Browse repository at this point
Copy the full SHA 64e270aView commit details -
Use new NestedClassSet for configuring calculators
We have several actions, and several calculators. Not all calculators work for all actions (e.g. the DistributedAmountCalculator really only works for the AdjustLineItem action, and the `Tiered` ones don't work for `AdjustLineItemQuantityGroups`. Rather than creating a new configuration option for each calculator, let's use something like a Hash here.
Configuration menu - View commit details
-
Copy full SHA for d0d3f53 - Browse repository at this point
Copy the full SHA d0d3f53View commit details -
This is to allow us to release versions in a simple, standard-compliant fashion.
Configuration menu - View commit details
-
Copy full SHA for 5ab5508 - Browse repository at this point
Copy the full SHA 5ab5508View commit details -
Refactor to FriendlyPromotion::FriendlyPromotionAdjuster
This changes the API of the main class we're working with from `SolidusFriendlyPromotions::OrderDiscounter` to `SolidusFriendlyPromotions::FriendlyPromotionsAdjuster`. This class now simply calls the three other (otherwise somewhat confusingly named) service objects: - `LoadPromotions` - `DiscountOrder` - `PersistDiscountedOrder` This makes the code easier to read in my opinion, and simplifies the API for promotion handlers significantly.
Configuration menu - View commit details
-
Copy full SHA for c3243b6 - Browse repository at this point
Copy the full SHA c3243b6View commit details -
Rename: "additional_promotion" -> "dry_run_promotion"
When we test whether a promotion is eligible, what we do is we perform a dry run of the promotion adjuster. This change reflects that context in the naming of our arguments.
Configuration menu - View commit details
-
Copy full SHA for 3681cea - Browse repository at this point
Copy the full SHA 3681ceaView commit details -
Move DiscountableAmounts into app/models/concerns
This is to aid readability.
Configuration menu - View commit details
-
Copy full SHA for 122193f - Browse repository at this point
Copy the full SHA 122193fView commit details -
Refactor ChoosePromotions service class
This class suffered of unnecessary variables, and can also live with the service classes for the FriendlyPromotionAdjuster. It also could use a spec.
Configuration menu - View commit details
-
Copy full SHA for 3846876 - Browse repository at this point
Copy the full SHA 3846876View commit details -
Move rule concerns to app/concerns
These are modules, and Rails offers a place for modules.
Configuration menu - View commit details
-
Copy full SHA for 90dc209 - Browse repository at this point
Copy the full SHA 90dc209View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3ad195b - Browse repository at this point
Copy the full SHA 3ad195bView commit details -
This class is useful for satisfying Solidus' need for a shipping promotion handler. With SolidusFriendlyPromotions, shipping promotions are handled just like other promotions, so we don't need to do anything here.
Configuration menu - View commit details
-
Copy full SHA for 0683b19 - Browse repository at this point
Copy the full SHA 0683b19View commit details -
We want to have an action that creates a new discounted line item. Its discount should never be affected by promotions in previous lanes.
Configuration menu - View commit details
-
Copy full SHA for 0d955e4 - Browse repository at this point
Copy the full SHA 0d955e4View commit details -
Add action association to LineItem
We want to be able to add a line item associated to a promotion actions (to see who created it).
Configuration menu - View commit details
-
Copy full SHA for 1887e27 - Browse repository at this point
Copy the full SHA 1887e27View commit details -
Add basic version of CreateDiscountedItem class
This also introduced the `SolidusFriendlyPromotion::Actions::Automation` module that indicates this action is an automation. It's only available at the order level.
Configuration menu - View commit details
-
Copy full SHA for eff7322 - Browse repository at this point
Copy the full SHA eff7322View commit details -
Make sure goodies are not treated like regular line items
Solidus offers line item comparison hooks, and we'll make use of them.
Configuration menu - View commit details
-
Copy full SHA for d32136d - Browse repository at this point
Copy the full SHA d32136dView commit details -
Configuration menu - View commit details
-
Copy full SHA for fa30fcd - Browse repository at this point
Copy the full SHA fa30fcdView commit details -
Initialize variant autocomplete on page load
This is not done automatically in Solidus, so we have to do it here.
Configuration menu - View commit details
-
Copy full SHA for 02affac - Browse repository at this point
Copy the full SHA 02affacView commit details -
Configuration menu - View commit details
-
Copy full SHA for edc44d6 - Browse repository at this point
Copy the full SHA edc44d6View commit details -
Calculators and Actions: Ignore automatic items
Automatic items are probably already 100% discounted, and it's really hard to make their discounts play well with others.
Configuration menu - View commit details
-
Copy full SHA for d7dce3c - Browse repository at this point
Copy the full SHA d7dce3cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 23f0589 - Browse repository at this point
Copy the full SHA 23f0589View commit details -
Configuration menu - View commit details
-
Copy full SHA for e36e1e8 - Browse repository at this point
Copy the full SHA e36e1e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9fadb78 - Browse repository at this point
Copy the full SHA 9fadb78View commit details -
Configuration menu - View commit details
-
Copy full SHA for e67150c - Browse repository at this point
Copy the full SHA e67150cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3907ee3 - Browse repository at this point
Copy the full SHA 3907ee3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 23949cd - Browse repository at this point
Copy the full SHA 23949cdView commit details -
We want to see at a glance what the lanes of our promotions are.
Configuration menu - View commit details
-
Copy full SHA for 331cb16 - Browse repository at this point
Copy the full SHA 331cb16View commit details -
Only display usage count for for promotions with usage limit
It's quite slow to calculate usage counts. Let's instead display an infinity symbol for promotions that don't have a usage limit.
Configuration menu - View commit details
-
Copy full SHA for 2ff7292 - Browse repository at this point
Copy the full SHA 2ff7292View commit details -
Usage: Indicate usage of promotions without usage limit
When a promotion has no usage limit, we can still tell admins whether a promotion has been used at all. Counting one is not so hard.
Configuration menu - View commit details
-
Copy full SHA for 0959ab3 - Browse repository at this point
Copy the full SHA 0959ab3View commit details -
Configuration menu - View commit details
-
Copy full SHA for f037db2 - Browse repository at this point
Copy the full SHA f037db2View commit details -
Allow filtering by active date
This does not set a default filter, so we can still see all promotions, but it's real easy to set the filter to today.
Configuration menu - View commit details
-
Copy full SHA for 3c35bb6 - Browse repository at this point
Copy the full SHA 3c35bb6View commit details -
Configuration menu - View commit details
-
Copy full SHA for b91360c - Browse repository at this point
Copy the full SHA b91360cView commit details -
Fix translation for "number of codes"
This way the column makes more sense in the admin.
Configuration menu - View commit details
-
Copy full SHA for de58dda - Browse repository at this point
Copy the full SHA de58ddaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ee47d8 - Browse repository at this point
Copy the full SHA 5ee47d8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3be188e - Browse repository at this point
Copy the full SHA 3be188eView commit details -
Configuration menu - View commit details
-
Copy full SHA for f9809a2 - Browse repository at this point
Copy the full SHA f9809a2View commit details -
Configuration menu - View commit details
-
Copy full SHA for a60fc8e - Browse repository at this point
Copy the full SHA a60fc8eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 387ba07 - Browse repository at this point
Copy the full SHA 387ba07View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9793fea - Browse repository at this point
Copy the full SHA 9793feaView commit details -
Use Remix icons if Solidus' admin_updated_navbar is enabled
Solidus 2.4 introduced a new admin navbar with new icons that can be enabled in the settings. Adopt to that.
Configuration menu - View commit details
-
Copy full SHA for 6400ebe - Browse repository at this point
Copy the full SHA 6400ebeView commit details -
Coupon Promo Handler: Fix flaky spec
Promotion Rules are not ordered, so the database might return them in any order. This adjusts the spec accordingly (especially Postgres returns them in a different order than expected sometimes).
Configuration menu - View commit details
-
Copy full SHA for 85ef429 - Browse repository at this point
Copy the full SHA 85ef429View commit details -
Refactor: Extract
Promotion#applicable_line_items
There are now three spots in this code base that need a method to collect the line items that pass all applicable rules for an order and can be discounted. Time to extract.
Configuration menu - View commit details
-
Copy full SHA for ce0859b - Browse repository at this point
Copy the full SHA ce0859bView commit details -
Allow changing quantity for automatic line items
When we do a buy-one-get-one-free promotion, you should get TWO free when you buy two. Ruby doesn't really allow changing methods based on who calls, so we have to use the `quantity_setter` attr_accessor as a kind of lock that unlocks setting the quantity when we want it.
Configuration menu - View commit details
-
Copy full SHA for 3a8f62c - Browse repository at this point
Copy the full SHA 3a8f62cView commit details -
Make CreateDiscountedItem able to do Buy N get N free
There's two quantities we want to configure. Buy X get Y free...
Configuration menu - View commit details
-
Copy full SHA for 8b2f548 - Browse repository at this point
Copy the full SHA 8b2f548View commit details -
Provide calculator description with calculator fields
Without the description, the calculator name might not tell you enough about how the calculator works. This is especially true for the tiered calculcators.
Configuration menu - View commit details
-
Copy full SHA for a573bb5 - Browse repository at this point
Copy the full SHA a573bb5View commit details -
Create tiered calculator based on eligible item quantity
So you get a percentage based on how many items that match the criteria the customer has in their cart!
Configuration menu - View commit details
-
Copy full SHA for 19d586c - Browse repository at this point
Copy the full SHA 19d586cView commit details -
Configuration menu - View commit details
-
Copy full SHA for e9db977 - Browse repository at this point
Copy the full SHA e9db977View commit details -
Configuration menu - View commit details
-
Copy full SHA for 151b173 - Browse repository at this point
Copy the full SHA 151b173View commit details -
Configuration menu - View commit details
-
Copy full SHA for 80843e8 - Browse repository at this point
Copy the full SHA 80843e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 20204a9 - Browse repository at this point
Copy the full SHA 20204a9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5c2272c - Browse repository at this point
Copy the full SHA 5c2272cView commit details -
Configuration menu - View commit details
-
Copy full SHA for a407410 - Browse repository at this point
Copy the full SHA a407410View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8f8597e - Browse repository at this point
Copy the full SHA 8f8597eView commit details -
Replace references to OrderDiscounter with FriendlyPromotionAdjuster
The default promotion adjuster has been renamed, and that has to be reflected in the README and in the migration guide.
Configuration menu - View commit details
-
Copy full SHA for f1b895a - Browse repository at this point
Copy the full SHA f1b895aView commit details -
Documentation: Use released version of this gem
We want user's to take advantage of semantic versioning.
Configuration menu - View commit details
-
Copy full SHA for ad95d45 - Browse repository at this point
Copy the full SHA ad95d45View commit details -
Add section about migrating Coupon Promotion Handler
This adds a documentation section so people know they have to change explicit references to the legacy system's promotion handler.
Configuration menu - View commit details
-
Copy full SHA for d871763 - Browse repository at this point
Copy the full SHA d871763View commit details -
Configuration menu - View commit details
-
Copy full SHA for 895b482 - Browse repository at this point
Copy the full SHA 895b482View commit details -
Configuration menu - View commit details
-
Copy full SHA for 051b8cb - Browse repository at this point
Copy the full SHA 051b8cbView commit details -
New standard version, new rules, new fixes.
Configuration menu - View commit details
-
Copy full SHA for b79fc70 - Browse repository at this point
Copy the full SHA b79fc70View commit details -
Add configuration option:
recalculate_complete_orders
This gem allows recalculating complete orders until they are shipped, because Solidus allows changing an order's contents until the order is shipped. This change adds a configuration option that disables the recalculation of orders after they are completed. Some shops make changes to existing promotions, and expect that this does not change complete, but unshipped orders.
Configuration menu - View commit details
-
Copy full SHA for f5bc4e0 - Browse repository at this point
Copy the full SHA f5bc4e0View commit details -
Configuration menu - View commit details
-
Copy full SHA for df022ae - Browse repository at this point
Copy the full SHA df022aeView commit details -
Define SolidusFriendlyPromotions.table_name_prefix early
In Rails 7.1.3, the `table_name_prefix` method is redefined if it is not already defined. Since we have multiple module definitions, we need to make sure that the class method is defined before we load `engine.rb`.
Configuration menu - View commit details
-
Copy full SHA for bd7bc5f - Browse repository at this point
Copy the full SHA bd7bc5fView commit details -
Revert "Temporarily disable running specs for Solidus main"
This reverts commit 6a69d1a35340b650fec1040da8184b4ec59964f1.
Configuration menu - View commit details
-
Copy full SHA for f7bdc68 - Browse repository at this point
Copy the full SHA f7bdc68View commit details -
Add admin UI for promotion code batches
This was somehow missed in the past. Fixes solidusio#93
Configuration menu - View commit details
-
Copy full SHA for c03a305 - Browse repository at this point
Copy the full SHA c03a305View commit details -
Add missing association between promo codes and order promotions
This fixes the foreign key constraint error when deleting a promotion code that has been applied to an order. This will, of course, change the applicability of the promotion in question for that particular order. If the order is shipped, no worries though: The adjustments will stay as our service object will not try to recalculate. If the order is not shipped, the promotion will stop being applied. However, if you as a user deleted the promotion or the promotion code, that's probably what you want. Fixes solidusio#94
Configuration menu - View commit details
-
Copy full SHA for 42cb6f8 - Browse repository at this point
Copy the full SHA 42cb6f8View commit details -
Let's use the `discard` gem for soft-deleting promotions.
Configuration menu - View commit details
-
Copy full SHA for 041493b - Browse repository at this point
Copy the full SHA 041493bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 734e7f0 - Browse repository at this point
Copy the full SHA 734e7f0View commit details -
Disable the new admin temporarily
There are still a few bugs with the new admin, so let's disable that for the time being.
Configuration menu - View commit details
-
Copy full SHA for 7fb5e73 - Browse repository at this point
Copy the full SHA 7fb5e73View commit details -
UI work for soft-deleted promotions
We don't want to allow people to edit or re-create deleted promotions, so we just indicate they're there for now. Let's see if we find a need to show them in some kind of uneditable mode.
Configuration menu - View commit details
-
Copy full SHA for e50f9e3 - Browse repository at this point
Copy the full SHA e50f9e3View commit details -
Disallow destroying promotion actions for completed orders
When a promotion has been applied to an order, we need to make sure no adjustments remain that have that promotion's actions as their source. For incomplete orders, we can simply delete the adjustments, but for complete orders, we must stop the promotion action from being deleted.
Configuration menu - View commit details
-
Copy full SHA for 87b5529 - Browse repository at this point
Copy the full SHA 87b5529View commit details -
Actually destroy promotion actions
We now protect against destroying promotion actions that have been applied to a complete order, so we can stop the dependent: :nullify thing.
Configuration menu - View commit details
-
Copy full SHA for 8e4099d - Browse repository at this point
Copy the full SHA 8e4099dView commit details -
Actually destroy promotion actions
There's no need for soft-delete on promotion actions, now that we have soft-delete on promotions.
Configuration menu - View commit details
-
Copy full SHA for c922269 - Browse repository at this point
Copy the full SHA c922269View commit details -
Drop deleted_at from promotion actions
We don't need soft-delete on promotion actions when we have soft-delete on promotions.
Configuration menu - View commit details
-
Copy full SHA for cb6376b - Browse repository at this point
Copy the full SHA cb6376bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 23cbea2 - Browse repository at this point
Copy the full SHA 23cbea2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 03c22a5 - Browse repository at this point
Copy the full SHA 03c22a5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 21d4221 - Browse repository at this point
Copy the full SHA 21d4221View commit details -
We were using Spree helpers before; those don't exist anymore. Also we missed importing the PromotionsHelper, and implicitly relied on the one provided by Solidus.
Configuration menu - View commit details
-
Copy full SHA for 75d2600 - Browse repository at this point
Copy the full SHA 75d2600View commit details -
In some spots we were still relying on Solidus partials, even though we have them in the app.
Configuration menu - View commit details
-
Copy full SHA for 66b7f37 - Browse repository at this point
Copy the full SHA 66b7f37View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6b15852 - Browse repository at this point
Copy the full SHA 6b15852View commit details -
Change activation UI to not rely on JS
Previously, the activation UI for promotions was based on complicated Javascript. This change allows us all the same options, and the user will be warned by validation errors if they try to create a promotion with both a code and the apply automatically option set. For existing promotions, `apply_automatically` will be disabled if either a path is set or a promo code is set.
Configuration menu - View commit details
-
Copy full SHA for 3ab16c2 - Browse repository at this point
Copy the full SHA 3ab16c2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1f4b2ab - Browse repository at this point
Copy the full SHA 1f4b2abView commit details -
Reintroduce nilling empty paths
This got by undetected because the spec was using the wrong model name.
Configuration menu - View commit details
-
Copy full SHA for b6b082c - Browse repository at this point
Copy the full SHA b6b082cView commit details -
Configuration menu - View commit details
-
Copy full SHA for d33831f - Browse repository at this point
Copy the full SHA d33831fView commit details -
Display path input field if present
If this promotion is activated by a path, it makes sense to be able to change it.
Configuration menu - View commit details
-
Copy full SHA for e1f8dd9 - Browse repository at this point
Copy the full SHA e1f8dd9View commit details -
SQLite 2.0 has recently been released, but the Rails/Solidus ecosystem isn't quite there yet.
Configuration menu - View commit details
-
Copy full SHA for a0ad748 - Browse repository at this point
Copy the full SHA a0ad748View commit details -
Fix ShippingRateDiscount#promotion_action
Promotion actions are not soft-deletable anymore.
Configuration menu - View commit details
-
Copy full SHA for 8e035d4 - Browse repository at this point
Copy the full SHA 8e035d4View commit details -
Configuration menu - View commit details
-
Copy full SHA for c29ec2d - Browse repository at this point
Copy the full SHA c29ec2dView commit details -
Configuration menu - View commit details
-
Copy full SHA for ef55c01 - Browse repository at this point
Copy the full SHA ef55c01View commit details -
3.0 restricts us to an older Rails version which uses Selenium the wrong way.
Configuration menu - View commit details
-
Copy full SHA for 43acff9 - Browse repository at this point
Copy the full SHA 43acff9View commit details -
Fix Promotion Rule Unique per promotion validation
This used outdated syntax that did not actually work, and the spec indicated invalidity because of the promotion with ID = 1 not existing. Now we create a real promotion to test with, and we add the error in the correct way. As a bonus, we use I18n for the error message.
Configuration menu - View commit details
-
Copy full SHA for 9f92093 - Browse repository at this point
Copy the full SHA 9f92093View commit details -
The spec setup of this spec added two rules of the same type to a promotion. Because the uniqueness validation was flawed, this was not a problem previously. We're now adding a different type of line item rule here. The behavior of the spec stays mostly the same, but the error message changes (because the `LineItemTaxon` rule does not have super-nice errors).
Configuration menu - View commit details
-
Copy full SHA for dd38d28 - Browse repository at this point
Copy the full SHA dd38d28View commit details -
Configuration menu - View commit details
-
Copy full SHA for b8a2418 - Browse repository at this point
Copy the full SHA b8a2418View commit details -
Configuration menu - View commit details
-
Copy full SHA for aa3cd22 - Browse repository at this point
Copy the full SHA aa3cd22View commit details -
Associate promotion rules with their conditions It's easier to understand if we have multiple promotion actions that each have multiple promotion rules, than if we have multiple promotion actions that share a set of promotion rules on the promotion, some of which are relevant to the promo action and some which are not.
Configuration menu - View commit details
-
Copy full SHA for 09651b6 - Browse repository at this point
Copy the full SHA 09651b6View commit details -
Remove "relevant rules" method
This will be covered by directly associating rules to actions.
Configuration menu - View commit details
-
Copy full SHA for 8ed05a7 - Browse repository at this point
Copy the full SHA 8ed05a7View commit details -
Adjust friendly promotion adjuster spec
Interestingly, these specs are still green.
Configuration menu - View commit details
-
Copy full SHA for 51361b6 - Browse repository at this point
Copy the full SHA 51361b6View commit details -
Configuration menu - View commit details
-
Copy full SHA for d178787 - Browse repository at this point
Copy the full SHA d178787View commit details -
Promotion Rule: Rename "unique_per_promotion"
Also fix the error message to reference the action. Promotions can now have the same rule twice!
Configuration menu - View commit details
-
Copy full SHA for 8438b0f - Browse repository at this point
Copy the full SHA 8438b0fView commit details -
Do not initialize pickers twice
Solidus Backend already initializes the pickers, if we do it a second time, an error occurs.
Configuration menu - View commit details
-
Copy full SHA for df7d6a6 - Browse repository at this point
Copy the full SHA df7d6a6View commit details -
Nest rules under actions in UI
This large commit removes a lot of complexity by scoping rules to actions. Now, we do not have to distinguish between rules that apply for all actions and rules that are scoped to only some actions, and it's far more understandable how a rule comes to be.
Configuration menu - View commit details
-
Copy full SHA for caaee28 - Browse repository at this point
Copy the full SHA caaee28View commit details -
This is to create the API needed for fulfilling the contract described in solidusio#5739.
Configuration menu - View commit details
-
Copy full SHA for 3d2d485 - Browse repository at this point
Copy the full SHA 3d2d485View commit details -
Provide extension point for advertiser class
Again, this is to fulfil the API requirements specified in solidusio#5739.
Configuration menu - View commit details
-
Copy full SHA for f4789ce - Browse repository at this point
Copy the full SHA f4789ceView commit details -
Rename Promotion Rule Route and Controller
... also rename all the partials.
Configuration menu - View commit details
-
Copy full SHA for 8f51f08 - Browse repository at this point
Copy the full SHA 8f51f08View commit details -
Rename promotion rule to "condition"
A rule is conceptually conditions attached to an action. In this gem, hoever, what we call "rules" are just conditions. This renames them appropriately.
Configuration menu - View commit details
-
Copy full SHA for 65f69c1 - Browse repository at this point
Copy the full SHA 65f69c1View commit details -
Move condition form partials to admin/condition_forms
This reads much better than `admin/conditions/conditions`.
Configuration menu - View commit details
-
Copy full SHA for a1b3ae4 - Browse repository at this point
Copy the full SHA a1b3ae4View commit details -
Rename promotion action to benefits: Routes, Controllers, Views
Promotion Action is very generic and wordy. Just using "Action" does not work, because Rails will confuse it with its own concept of "Action". This changes the routes and params, and moves the individual promotion action forms to a benefit_forms directory.
Configuration menu - View commit details
-
Copy full SHA for 30ad834 - Browse repository at this point
Copy the full SHA 30ad834View commit details -
Rename PromotionAction model to Benefit
It's clearer, and does not conflict with a lot of Rails nomenclature.
Configuration menu - View commit details
-
Copy full SHA for cdcf165 - Browse repository at this point
Copy the full SHA cdcf165View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5004a5e - Browse repository at this point
Copy the full SHA 5004a5eView commit details -
These checks are not necessary any longer.
Configuration menu - View commit details
-
Copy full SHA for 772336e - Browse repository at this point
Copy the full SHA 772336eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5c2886d - Browse repository at this point
Copy the full SHA 5c2886dView commit details -
Add validation for condition type
Not all conditions work for all benefits. Validating this helps us with the UI, and it exposes some odd things in the spec suite.
Configuration menu - View commit details
-
Copy full SHA for a8d0117 - Browse repository at this point
Copy the full SHA a8d0117View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4e9dbfb - Browse repository at this point
Copy the full SHA 4e9dbfbView commit details -
Use Bootstrap cards to improve Admin UI
We don't have the CSS from the classic promotions admin - but that CSS wasn't all that great to begin with. However, we do have Bootstrap and can make full use of it.
Configuration menu - View commit details
-
Copy full SHA for b9d74d8 - Browse repository at this point
Copy the full SHA b9d74d8View commit details -
Convert product picker to Web Component
Much easier than having to initialize manually.
Configuration menu - View commit details
-
Copy full SHA for 9f99b21 - Browse repository at this point
Copy the full SHA 9f99b21View commit details -
Configuration menu - View commit details
-
Copy full SHA for 84af1ae - Browse repository at this point
Copy the full SHA 84af1aeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 830ae1b - Browse repository at this point
Copy the full SHA 830ae1bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 102e139 - Browse repository at this point
Copy the full SHA 102e139View commit details -
Configuration menu - View commit details
-
Copy full SHA for bf64aa0 - Browse repository at this point
Copy the full SHA bf64aa0View commit details -
Configuration menu - View commit details
-
Copy full SHA for c347cc1 - Browse repository at this point
Copy the full SHA c347cc1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 813e66b - Browse repository at this point
Copy the full SHA 813e66bView commit details -
Convert NumberWithCurrency to WebComponent
This isn't quite working yet.
Configuration menu - View commit details
-
Copy full SHA for 26e93a2 - Browse repository at this point
Copy the full SHA 26e93a2View commit details -
We want to have some friction here, and communicate clearly there's no benefits or conditions.
Configuration menu - View commit details
-
Copy full SHA for e2d6c39 - Browse repository at this point
Copy the full SHA e2d6c39View commit details -
We also wrap selecttwo in a Web Component, because it's just so good.
Configuration menu - View commit details
-
Copy full SHA for c7d0469 - Browse repository at this point
Copy the full SHA c7d0469View commit details -
Import preference field partials from Solidus
Use form-group everywhere.
Configuration menu - View commit details
-
Copy full SHA for 77a7211 - Browse repository at this point
Copy the full SHA 77a7211View commit details -
This form was almost unintelligible before this change.
Configuration menu - View commit details
-
Copy full SHA for 2b62b3b - Browse repository at this point
Copy the full SHA 2b62b3bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7f36e44 - Browse repository at this point
Copy the full SHA 7f36e44View commit details -
Configuration menu - View commit details
-
Copy full SHA for b3b280d - Browse repository at this point
Copy the full SHA b3b280dView commit details -
Improve percent calculator field
This should be a number field, and it's the most important calculator anyways.
Configuration menu - View commit details
-
Copy full SHA for bbdb7c0 - Browse repository at this point
Copy the full SHA bbdb7c0View commit details -
Configuration menu - View commit details
-
Copy full SHA for a754508 - Browse repository at this point
Copy the full SHA a754508View commit details -
Configuration menu - View commit details
-
Copy full SHA for c3d03ca - Browse repository at this point
Copy the full SHA c3d03caView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4497f44 - Browse repository at this point
Copy the full SHA 4497f44View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0ada88f - Browse repository at this point
Copy the full SHA 0ada88fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 395fb83 - Browse repository at this point
Copy the full SHA 395fb83View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1d6e145 - Browse repository at this point
Copy the full SHA 1d6e145View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8a78588 - Browse repository at this point
Copy the full SHA 8a78588View commit details -
Rename folder "condition_forms" to "condition_fields"
Explicit is better than implicit.
Configuration menu - View commit details
-
Copy full SHA for 8fed749 - Browse repository at this point
Copy the full SHA 8fed749View commit details -
Rename folder "condition_forms" to "condition_fields"
Explicit is better than implicit.
Configuration menu - View commit details
-
Copy full SHA for d73ad82 - Browse repository at this point
Copy the full SHA d73ad82View commit details -
Move calculator fields one level up
Calculators are their own model, and we can just move them one level up, shortening some view references.
Configuration menu - View commit details
-
Copy full SHA for eb4459c - Browse repository at this point
Copy the full SHA eb4459cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 544e340 - Browse repository at this point
Copy the full SHA 544e340View commit details -
When applying or validating an order_promotion, we load all associated promotions and check their usage limit. A discarded promotion can still be associated with an order. If we do not load discarded promotions, then the order_promotion will not have an associated promotion and checking usage limits will result in an error.
Configuration menu - View commit details
-
Copy full SHA for 6b6ee58 - Browse repository at this point
Copy the full SHA 6b6ee58View commit details -
Add spec for destroying dependent order promotions
When we delete a promotion, we want to be sure that dependent order promotions are also deleted.
Configuration menu - View commit details
-
Copy full SHA for 8c2fba5 - Browse repository at this point
Copy the full SHA 8c2fba5View commit details -
Delete cart connections when discarding promotions
This is an additional safeguard that makes sure orders do not get discarded promotions applied to their carts (by removing any manual connections through e.g. promotion codes).
Configuration menu - View commit details
-
Copy full SHA for ff86582 - Browse repository at this point
Copy the full SHA ff86582View commit details -
Update README to reflect naming changes
Promotion Actions have been renamed to Benefits, and Promotion Rules to Conditions. This needs to be reflected in the README.
Configuration menu - View commit details
-
Copy full SHA for 4da1597 - Browse repository at this point
Copy the full SHA 4da1597View commit details -
Configuration menu - View commit details
-
Copy full SHA for 09ba545 - Browse repository at this point
Copy the full SHA 09ba545View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4edb2d3 - Browse repository at this point
Copy the full SHA 4edb2d3View commit details -
Configuration menu - View commit details
-
Copy full SHA for f790e73 - Browse repository at this point
Copy the full SHA f790e73View commit details -
Configuration menu - View commit details
-
Copy full SHA for f3cded9 - Browse repository at this point
Copy the full SHA f3cded9View commit details -
Configuration menu - View commit details
-
Copy full SHA for d92e4cd - Browse repository at this point
Copy the full SHA d92e4cdView commit details -
Configuration menu - View commit details
-
Copy full SHA for e4b185e - Browse repository at this point
Copy the full SHA e4b185eView commit details -
Configuration menu - View commit details
-
Copy full SHA for aff229d - Browse repository at this point
Copy the full SHA aff229dView commit details -
Only run against Solidus' main branch
Solidus' promotion configuration interface changes a bit in 4.4, and with SolidusFriendlyPromotions 2.0 we want to adapt those changes.
Configuration menu - View commit details
-
Copy full SHA for 494eb84 - Browse repository at this point
Copy the full SHA 494eb84View commit details -
Use Spree::SimpleOrderContents
We don't need to provide our own implementation any longer, Solidus ships with it!
Configuration menu - View commit details
-
Copy full SHA for b527d5d - Browse repository at this point
Copy the full SHA b527d5dView commit details -
Use Spree::Config.promotions.order_adjuster_class
Solidus has a new configuration endpoint for the promotions order adjuster class. Implement it.
Configuration menu - View commit details
-
Copy full SHA for d9ff32f - Browse repository at this point
Copy the full SHA d9ff32fView commit details -
Remove patch to Spree::Order.apply_shipping_promotions
This is not needed any longer, as this method is only implemented in solidus_legacy_promotions.
Configuration menu - View commit details
-
Copy full SHA for c7c5b7c - Browse repository at this point
Copy the full SHA c7c5b7cView commit details -
Remove Spree::Order#ensure_promotions_eligible override
This is present in Solidus core, identically.
Configuration menu - View commit details
-
Copy full SHA for 31c7cf2 - Browse repository at this point
Copy the full SHA 31c7cf2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 728f971 - Browse repository at this point
Copy the full SHA 728f971View commit details -
Add Coupon Code Handler configuration
This allows the API feature spec to go through.
Configuration menu - View commit details
-
Copy full SHA for 5a7ba03 - Browse repository at this point
Copy the full SHA 5a7ba03View commit details -
This is necessary for the API promotion endpoint to work.
Configuration menu - View commit details
-
Copy full SHA for 9857a37 - Browse repository at this point
Copy the full SHA 9857a37View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4fc5705 - Browse repository at this point
Copy the full SHA 4fc5705View commit details -
Use Spree::Config.adjustment_promotion_source_types
We don't need to override Spree::Adjustment.promotion and Spree::Adjustment#promotion?
Configuration menu - View commit details
-
Copy full SHA for 9de61be - Browse repository at this point
Copy the full SHA 9de61beView commit details -
This will reset the connected order promotions when an order is emptied.
Configuration menu - View commit details
-
Copy full SHA for 3a2b889 - Browse repository at this point
Copy the full SHA 3a2b889View commit details -
Only build on Ruby 3.3.2 for now
3.3.3 has weird issues, see https://stackoverflow.com/questions/78617432/strange-bundle-update-issue-disappearing-net-pop-0-1-2-dependency
Configuration menu - View commit details
-
Copy full SHA for e415253 - Browse repository at this point
Copy the full SHA e415253View commit details -
Almost all of our specs don't use the RSpec DSL at the top level. This adds `RSpec.` to the ones that do.
Configuration menu - View commit details
-
Copy full SHA for 6c6dac0 - Browse repository at this point
Copy the full SHA 6c6dac0View commit details -
This was relying on Solidus Legacy Promotions' permission set to be present, and it was testing the backend configuration with the redirect.
Configuration menu - View commit details
-
Copy full SHA for ff99687 - Browse repository at this point
Copy the full SHA ff99687View commit details -
Use our PromotionCodeBatchBuilder in spec
Spree::PromotionCodeBatchBuilder is from another gem.
Configuration menu - View commit details
-
Copy full SHA for 67553f1 - Browse repository at this point
Copy the full SHA 67553f1View commit details -
PromotionCodeBatchJob: Inherit from ActiveJob::Base
We have no ApplicationJob.
Configuration menu - View commit details
-
Copy full SHA for d2bf5e8 - Browse repository at this point
Copy the full SHA d2bf5e8View commit details -
Move default configuration from initializer to config
With the initializer, we need a full Rails app to test the presence of the default classes. By leveraging `add_class_set` and `add_nested_class_set` from Solidus core with their `default` option, we don't need to do as much in the initializer.
Configuration menu - View commit details
-
Copy full SHA for 8383e68 - Browse repository at this point
Copy the full SHA 8383e68View commit details -
Configuration menu - View commit details
-
Copy full SHA for 38c3585 - Browse repository at this point
Copy the full SHA 38c3585View commit details -
Without this, we get version conflicts (but our code works with both 1.4 and 2.x)
Configuration menu - View commit details
-
Copy full SHA for 2a29fd9 - Browse repository at this point
Copy the full SHA 2a29fd9View commit details -
Workaround to stop ActionCable from loading
We don't need ActionCable, and it's not loaded in our test suite. This stops Turbo from autoloading channels that need it. We don't need it.
Configuration menu - View commit details
-
Copy full SHA for 0e3a223 - Browse repository at this point
Copy the full SHA 0e3a223View commit details -
This updates the `MIGRATING.md` file to reflect the current state of the gem.
Configuration menu - View commit details
-
Copy full SHA for 860a409 - Browse repository at this point
Copy the full SHA 860a409View commit details -
Move controllers and views to lib/
This is the first step in making this gem independent of solidus_backend.
Configuration menu - View commit details
-
Copy full SHA for f2c0788 - Browse repository at this point
Copy the full SHA f2c0788View commit details -
Only do backend stuff if it's available
We don't depend on solidus_backend, and stores should be able to load the extension even if they don't use the backend.
Configuration menu - View commit details
-
Copy full SHA for 884e35a - Browse repository at this point
Copy the full SHA 884e35aView commit details -
Rename spec directory for backend tests
Admin conflicts with the name for solidus_admin tests that will be coming up.
Configuration menu - View commit details
-
Copy full SHA for 1e3f6d6 - Browse repository at this point
Copy the full SHA 1e3f6d6View commit details -
Split rails_helper and spec_helper
This mirrors what is done in Solidus core, and is cleaner anyways.
Configuration menu - View commit details
-
Copy full SHA for ee28fcc - Browse repository at this point
Copy the full SHA ee28fccView commit details -
Use inline dummy app from Solidus core
This is more in-line with the core Solidus gems, and it is also a lot faster.
Configuration menu - View commit details
-
Copy full SHA for 192e3b0 - Browse repository at this point
Copy the full SHA 192e3b0View commit details -
Configuration menu - View commit details
-
Copy full SHA for da03b06 - Browse repository at this point
Copy the full SHA da03b06View commit details -
Require legacy promotions for test suite
Without this before the DummyApp call, we don't get the migrations and models from `solidus_legacy_promotions` that we need.
Configuration menu - View commit details
-
Copy full SHA for bef8281 - Browse repository at this point
Copy the full SHA bef8281View commit details -
Support
solidus_admin
in the test suiteThis loads the SolidusAdmin gem if available, and adds the routes to the Dummy App if the example in question is marked `solidus_admin`. In addition, this loads the accessibility matchers many of the admin specs need.
Configuration menu - View commit details
-
Copy full SHA for fb478fd - Browse repository at this point
Copy the full SHA fb478fdView commit details -
Add component "SolidusFriendlyPromotionsBenefit"
This allows the new Solidus Admin to display Adjustments with a source of type `SolidusFriendlyPromotions::Benefit`.
Configuration menu - View commit details
-
Copy full SHA for cdfed87 - Browse repository at this point
Copy the full SHA cdfed87View commit details -
Configuration menu - View commit details
-
Copy full SHA for b54cc16 - Browse repository at this point
Copy the full SHA b54cc16View commit details -
Fix completed order with promotion factory
This was referencing a factory from solidus_legacy_promotions
Configuration menu - View commit details
-
Copy full SHA for ae24f22 - Browse repository at this point
Copy the full SHA ae24f22View commit details -
Configuration menu - View commit details
-
Copy full SHA for e326f5e - Browse repository at this point
Copy the full SHA e326f5eView commit details -
Configuration menu - View commit details
-
Copy full SHA for d89865a - Browse repository at this point
Copy the full SHA d89865aView commit details -
Add promotion categories admin for solidus_admin
This is all that's implemented in core currently.
Configuration menu - View commit details
-
Copy full SHA for dc8a64e - Browse repository at this point
Copy the full SHA dc8a64eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 80ef2f4 - Browse repository at this point
Copy the full SHA 80ef2f4View commit details -
Remove
require_promotion_code
overrideWith solidusio@10b555b merged, we don't need this override anymore, and our build should go green again.
Configuration menu - View commit details
-
Copy full SHA for 266faa3 - Browse repository at this point
Copy the full SHA 266faa3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 260fbde - Browse repository at this point
Copy the full SHA 260fbdeView commit details -
This is still mentioning actions when we mean to say benefits.
Configuration menu - View commit details
-
Copy full SHA for 88464b9 - Browse repository at this point
Copy the full SHA 88464b9View commit details -
Only add foreign key if necessary
If this is a vanilla install, we cannot make a foreign key constraint to the `spree_promotions` table as it is not present.
Configuration menu - View commit details
-
Copy full SHA for aea0326 - Browse repository at this point
Copy the full SHA aea0326View commit details -
Do not sync old order promotions by default
In case we don't have the legacy promotion system present, we can't sync things by default.
Configuration menu - View commit details
-
Copy full SHA for 8c945ee - Browse repository at this point
Copy the full SHA 8c945eeView commit details -
Sync legacy order promotions by default in initializer
This way we keep our specs clear of the legacy_promotions gem, but we provide a way of syncing that is visible.
Configuration menu - View commit details
-
Copy full SHA for a1945a7 - Browse repository at this point
Copy the full SHA a1945a7View commit details -
Use ActiveRecord::Migration[7.0]
Solidus still supports Rails 7.0, and we should, too.
Configuration menu - View commit details
-
Copy full SHA for a8ee9b5 - Browse repository at this point
Copy the full SHA a8ee9b5View commit details -
Stop using Adjustment#eligible throughout the gem
Adjustment#eligible defaults to true, and we never set it to false. It's a remnant of the legacy promotion system. I'm also changing the spec setup of those specs that indicate ineligible promotion adjustments from setting the eligible flag to false to setting the promotion up with an impossible condition instead.
Configuration menu - View commit details
-
Copy full SHA for 3d9e1c9 - Browse repository at this point
Copy the full SHA 3d9e1c9View commit details -
Remove promotion_code#adjustments
This association is not used anywhere in the codebase, and it's probably a remnant of adjustments being directly associated with promotion codes. SolidusLegacyPromotions does this, but we have no need for this, because we can just as well join via the `friendly_order_promotions` table. An adjustment from a promotion with codes will have one of the promotion benefits as a source, and an order_promotion with a reference to the promotion code used. I could have also changed the association to one that follows this path, but I'm really not sure what we would use this association for.
Configuration menu - View commit details
-
Copy full SHA for 7353bbf - Browse repository at this point
Copy the full SHA 7353bbfView commit details -
In friendlycart/solidus_friendly_promotions#130, we changed the default of SolidusFriendlyPromotions.config.sync_order_promotions, but failed to adjust this spec accordingly.
Configuration menu - View commit details
-
Copy full SHA for e699705 - Browse repository at this point
Copy the full SHA e699705View commit details -
In friendlycart/solidus_friendly_promotions#128 we renamed the config option `actions` to `benefits`, but failed to include that renaming in the benefits controller.
Configuration menu - View commit details
-
Copy full SHA for 70d29c6 - Browse repository at this point
Copy the full SHA 70d29c6View commit details -
Use SimpleOrderContents in specs
In our test suite, we need to have solidus_legacy_promotions loaded. This gem sets the `Spree::Config.order_contents_class` to the legacy `Spree::OrderContents`, but we need `SimpleOrderContents` so we don't run into the legacy promotion system.
Configuration menu - View commit details
-
Copy full SHA for 1bb26de - Browse repository at this point
Copy the full SHA 1bb26deView commit details -
Add Legacy Promotions to Rakefile
Otherwise we don't load solidus_legacy_promotions, and its migrations don't run.
Configuration menu - View commit details
-
Copy full SHA for b291164 - Browse repository at this point
Copy the full SHA b291164View commit details -
Integration spec: Be more explicit about spec setup
This spec was failing before because the sync option was not set.
Configuration menu - View commit details
-
Copy full SHA for 33b1693 - Browse repository at this point
Copy the full SHA 33b1693View commit details -
Add TestingSupport::FactoryBot
This mirrors the setup in Solidus core, and in Solidus Legacy Promotions.
Configuration menu - View commit details
-
Copy full SHA for cc011bf - Browse repository at this point
Copy the full SHA cc011bfView commit details -
Drop solidus_dev_support dependency
Solidus core does not depend on solidus_dev_support, so we should not either.
Configuration menu - View commit details
-
Copy full SHA for 4b9b980 - Browse repository at this point
Copy the full SHA 4b9b980View commit details -
Rollup migrations and change table name prefix
As preparation for the solidus integration, we don't need to create tables and then rename them. Let's rather have them the right name from the get-go.
Configuration menu - View commit details
-
Copy full SHA for fb8ddba - Browse repository at this point
Copy the full SHA fb8ddbaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 82d9583 - Browse repository at this point
Copy the full SHA 82d9583View commit details -
Friendly Promotions: Convert attribute accessor to preference
This has the same effect and removes a rubocop issue.
Configuration menu - View commit details
-
Copy full SHA for e46661f - Browse repository at this point
Copy the full SHA e46661fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 991ead8 - Browse repository at this point
Copy the full SHA 991ead8View commit details -
Prefix associations and factories with solidus_ instead of friendly_
In the new solidus_promotions gem, we need some way of distinguishing factories and associations from the legacy_promotion ones. In `solidus_friendly_promotions`, that prefix was `friendly_`, in `solidus_promotions`, it's `solidus_`.
Configuration menu - View commit details
-
Copy full SHA for 314fffb - Browse repository at this point
Copy the full SHA 314fffbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7dfec07 - Browse repository at this point
Copy the full SHA 7dfec07View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3de5c94 - Browse repository at this point
Copy the full SHA 3de5c94View commit details -
Configuration menu - View commit details
-
Copy full SHA for c59f5b7 - Browse repository at this point
Copy the full SHA c59f5b7View commit details -
Remove SolidusPromotions::TestingSupport module
It's not needed, we have SolidusPromotions::TestingSupport::FactoryBot.
Configuration menu - View commit details
-
Copy full SHA for b7b178c - Browse repository at this point
Copy the full SHA b7b178cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 43a9d07 - Browse repository at this point
Copy the full SHA 43a9d07View commit details -
Move line item comparison hook config to engine
This will always be available, and users should not configure it.
Configuration menu - View commit details
-
Copy full SHA for 029ca96 - Browse repository at this point
Copy the full SHA 029ca96View commit details -
Configuration menu - View commit details
-
Copy full SHA for 65c6242 - Browse repository at this point
Copy the full SHA 65c6242View commit details -
Configuration menu - View commit details
-
Copy full SHA for c8c8542 - Browse repository at this point
Copy the full SHA c8c8542View commit details -
Move menu code from initializer template to Engine
If we have this gem loaded, we definitely want it to be visible. We also want the menu items to be tested.
Configuration menu - View commit details
-
Copy full SHA for d0e4b41 - Browse repository at this point
Copy the full SHA d0e4b41View commit details -
Configuration menu - View commit details
-
Copy full SHA for 071040b - Browse repository at this point
Copy the full SHA 071040bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d60035 - Browse repository at this point
Copy the full SHA 6d60035View commit details -
Configuration menu - View commit details
-
Copy full SHA for f489083 - Browse repository at this point
Copy the full SHA f489083View commit details -
Spec coverage: Simplify ItemTotal#ineligible_message
The else case here cannot be reached (I tried), and the case statement is repeated in the method below.
Configuration menu - View commit details
-
Copy full SHA for 93e8c4a - Browse repository at this point
Copy the full SHA 93e8c4aView commit details -
Spec coverage: Comment out all lines in initializer
This does not make any difference but gives better stats.
Configuration menu - View commit details
-
Copy full SHA for ababd82 - Browse repository at this point
Copy the full SHA ababd82View commit details -
Configuration menu - View commit details
-
Copy full SHA for 42d8bd6 - Browse repository at this point
Copy the full SHA 42d8bd6View commit details -
All of these have no preferences, but associations, and therefore need to be updateable.
Configuration menu - View commit details
-
Copy full SHA for e7a5f9d - Browse repository at this point
Copy the full SHA e7a5f9dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 22fe73d - Browse repository at this point
Copy the full SHA 22fe73dView commit details -
Rename PermissionSet from Friendly to Solidus
Also fix the spec name so it actually runs.
Configuration menu - View commit details
-
Copy full SHA for a12bdf6 - Browse repository at this point
Copy the full SHA a12bdf6View commit details -
Configuration menu - View commit details
-
Copy full SHA for bd1a355 - Browse repository at this point
Copy the full SHA bd1a355View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0229961 - Browse repository at this point
Copy the full SHA 0229961View commit details -
Configuration menu - View commit details
-
Copy full SHA for 088690a - Browse repository at this point
Copy the full SHA 088690aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4db86f7 - Browse repository at this point
Copy the full SHA 4db86f7View commit details -
Rename FriendlyPromotionAdjuster to OrderAdjuster
This reflects better what it does.
Configuration menu - View commit details
-
Copy full SHA for 1ca6fb2 - Browse repository at this point
Copy the full SHA 1ca6fb2View commit details -
This looked a bit garbled without these extra w-100s.
Configuration menu - View commit details
-
Copy full SHA for e0d10ae - Browse repository at this point
Copy the full SHA e0d10aeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 996c4e2 - Browse repository at this point
Copy the full SHA 996c4e2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 06312f2 - Browse repository at this point
Copy the full SHA 06312f2View commit details -
Solidus Core now ships with a Null promotion handler.
Configuration menu - View commit details
-
Copy full SHA for 7555730 - Browse repository at this point
Copy the full SHA 7555730View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3d89ee3 - Browse repository at this point
Copy the full SHA 3d89ee3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 44a3a4d - Browse repository at this point
Copy the full SHA 44a3a4dView commit details -
We'll just be using Spree.solidus_version instead, like all the other gems.
Configuration menu - View commit details
-
Copy full SHA for dd6df37 - Browse repository at this point
Copy the full SHA dd6df37View commit details -
This is to indicate clearly that this JS is used for the backend UI.
Configuration menu - View commit details
-
Copy full SHA for f2bfd06 - Browse repository at this point
Copy the full SHA f2bfd06View commit details -
LineItemApplicableOrderCondition to LineItemApplicableOrderLevelCondi…
…tion This rename is for consistency only.
Configuration menu - View commit details
-
Copy full SHA for eb90119 - Browse repository at this point
Copy the full SHA eb90119View commit details -
Improve error messaging for unimplemented methods on Benefit
This allows developers to more clearly see what they need to do in order to implement custom promotion benefits.
Configuration menu - View commit details
-
Copy full SHA for 0212f9b - Browse repository at this point
Copy the full SHA 0212f9bView commit details -
Improve documentation and install generator
This should give developers better hints as to how to use this gem.
Configuration menu - View commit details
-
Copy full SHA for 326f117 - Browse repository at this point
Copy the full SHA 326f117View commit details -
Configuration menu - View commit details
-
Copy full SHA for cab3b5e - Browse repository at this point
Copy the full SHA cab3b5eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0136666 - Browse repository at this point
Copy the full SHA 0136666View commit details -
Improve performance of Promo Code Batch Builder
As pointed out in https://github.com/solidusio/solidus/pull/5383/files#r1391519251, the new promotion code batch builder had worse performance characteristics than the one in the legacy promotion system. This gets the characteristics back to those of the legacy promotion system. Time spent and memory usage still go up significantly and linearly with the number of batches. I ran some specs with the following code: ```rb context "with a very large number of promotion codes" do let(:number_of_codes) { 10000 } it "creates the correct number of codes" do puts Benchmark.measure { subject.build_promotion_codes } expect(promotion.codes.size).to eq(number_of_codes) end end ``` With a 1000 codes, I measured: ``` Randomized with seed 49097 1.036322 0.028977 1.065299 ( 1.074396) ``` With 10000 codes, I measured: ``` Randomized with seed 33250 9.606364 0.278920 9.885284 ( 9.978242) ``` Memory usage went up linearly as well.
Configuration menu - View commit details
-
Copy full SHA for 675eac0 - Browse repository at this point
Copy the full SHA 675eac0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 471db28 - Browse repository at this point
Copy the full SHA 471db28View commit details -
Fix documentation in persist_discounted_order.rb
Much of this code has been lifted from some tax abstraction in core, and some of the comments had not been updated.
Configuration menu - View commit details
-
Copy full SHA for 4c75a16 - Browse repository at this point
Copy the full SHA 4c75a16View commit details -
Configuration menu - View commit details
-
Copy full SHA for 98c7d4f - Browse repository at this point
Copy the full SHA 98c7d4fView commit details -
With the removal of our own .rubocop.yml, a few new linting problems appeared.
Configuration menu - View commit details
-
Copy full SHA for bf743d2 - Browse repository at this point
Copy the full SHA bf743d2View commit details