Skip to content
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

Update class methods to be instance methods. #3173

Merged
merged 1 commit into from
Apr 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions guides/source/developers/adjustments/overview.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,20 +137,20 @@ If you want to retrieve the line item adjustments, you can use the
`line_item_adjustments` method:

```ruby
Spree::Order.line_item_adjustments
Spree::Order.find(1).line_item_adjustments
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about using order.line_item_adjustments. I think it should be pretty clear that it refers to an instance of the Spree::Order` class. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going by the how the rest of the file is formatted I think we should take this route.

The adjustment scopes section is all formatted like this.

- `Spree::Order.find(1).adjustments.eligible`: Returns all of the eligible
  adjustments on the order with ID `1`.
- `Spree::LineItem.find(1).adjustments.eligible`: Returns all of the eligible
  adjustments on the line item with ID `1`.
- `Spree::Shipment.find(1).adjustments.eligible`: Returns all of the eligible
  adjustments on the shipment with ID `1`.

as well as part of the other adjustments docs.

Spree::Order.find(1).adjustments

That makes me imagine that this is probably a pattern found throughout these docs and for the sake of consistency we should follow it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think we should be consistent as well, thanks for pointing that out!

```

Or, if you want to retrieve the shipment adjustments, you can use the
`shipment_adjustments` method:

```ruby
Spree::Order.shipment_adjustments
Spree::Order.find(1).shipment_adjustments
```

Finally, if you want to retrieve all of the adjustments on the order, you can
use the `all_adjustments` method.

```ruby
Spree::Order.all_adjustments
Spree::Order.find(1).all_adjustments
```