Skip to content

Commit

Permalink
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions guides/source/developers/extensions/decorators.html.md
Original file line number Diff line number Diff line change
@@ -13,15 +13,13 @@ For example, if you want to add a method to the `Spree::Order` model, you could
create `/app/models/mystore/order_decorator.rb` with the following contents:

```ruby
module MyStore
module OrderDecorator
def total
super + BigDecimal(10.0)
end
module MyStore::OrderDecorator
def total
super + BigDecimal(10.0)
end
end

Spree::Order.prepend MyStore::OrderDecorator
Spree::Order.prepend self
end
```

This creates a new module called `MyStore::OrderDecorator` that prepends its

0 comments on commit b9c8add

Please sign in to comment.