spree/spree — pull request #2706 by gmacdougall (2013-03-15 23:07:14+00:00)
Title: Refactor available_to_order? in shipping method.

This is designed to make methods like this easier to manage through
extensions. In order to extend this, I can do the following:
```Ruby
Spree::ShippingMethod.class_eval do
available_to_order_if :my_special_condition?

def my_special_condition?(order)
# logic goes here
end
end
```
Previously I would have to override available_to_order? as well.

This makes it difficult to keep my extension up to date with Spree
revisions and makes it difficult to have multiple extensions modify
the behaviour of available_to_order? by adding additional restrictions.

I'm curious to get some input from the Spree team to see what you think about this. I feel that a change like this would make it much easier for extension writers to modify the functionality of Spree.

I'm currently looking at having two different extensions modify this bit of code (also, available payment methods) in order to support custom logic. Currently we have to manage some of that logic in our application rather than in the spree extensions.