Skip to content

Commit

Permalink
[Fix] Add Product#can_apply_discounts? (#4795)
Browse files Browse the repository at this point in the history
* Add Product#can_apply_discounts?
  • Loading branch information
joaquinco authored Nov 29, 2024
1 parent eafa678 commit 585200f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/product.rb
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@ def daily_booking?
false
end

def can_apply_discounts?
true
end

protected

def translation_scope
Expand Down
5 changes: 5 additions & 0 deletions spec/models/product_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
require "rails_helper"

RSpec.describe Product do
it "can apply discounts by default" do
product = Product.new
expect(product.can_apply_discounts?).to be true
end

describe "with everything configured" do
subject(:product) { create(:instrument_requiring_approval) }

Expand Down

0 comments on commit 585200f

Please sign in to comment.