<commit_before>h2. Spree 1.2.0 Release Notes

Spree 1.2.0 introduces some fairly major changes in the basic architecture of Spree, as well as minor alterations and bugfixes.

Due to the long development cycle of Spree 1.2 in parallel with continuing development of the 1.1 branch, there may be features released in 1.2 that are already present in 1.1.

endprologue.

h3. Summary

There were two major addressed within this release of Spree: custom authentication and better checkout customization.

The first was the ability to use Spree in conjunction with an application that already provided its own way to authenticate users. Due to how Spree was architected in the past, this was not as easy as it could have been. In this release of Spree, the auth component of Spree has been removed completely and placed into a separate extension called "spree_auth_devise":https://github.com/spree/spree_auth_devise. If you wish to continue using this component of Spree, you will need to specify this extension as a dependency in your Gemfile. See "Issue #1512":https://github.com/spree/spree/pull/1512 for more detail about the customization.

The checkout process has always been hard to customize within Spree, and that has generated complaints in the past. We are pleased to report in the 1.2 release of Spree that this has been substaintially easier with a new checkout DSL that allows you to re-define the checkout steps in a simple manner. For more information about this, please see "Issue #1418":https://github.com/spree/spree/pull/1418 and "Issue #1743":https://github.com/spree/spree/pull/1743.

Along with these two major issues, there were also a ton of minor improvements and bug fixes, explained in detail below.

h3. Major changes (backwards incompatibility)

h4. spree_auth removal

Authentication is disabled by default within Spree as of this release, with the application supposed to be providing its own authentication. If you have an application that depended on this functionality within Spree existing, please add "spree_auth_devise":https://github.com/spree/spree_auth_devise to your Gemfile and then put this line inside +config/initializers/spree.rb+ as well:

<ruby>
Spree.user_class = "Spree::User"
</ruby>

For more information, please see the "Authentication guide":http://guides.spreecommerce.com/authentication.html.

h4. State machine customizations

Customizing the state machine within Spree now does not require you to override the entire +state_machine+ definition within Spree's +Order+ model. Instead, you are provided with the ability to define the "next" events for +Order+ objects like this:

<ruby>
Spree::Order.class_eval do
  checkout_flow do
    go_to_state :address
    go_to_state :delivery
    go_to_state :payment, :if => lambda { payment_required? }
    go_to_state :confirm, :if => lambda { confirmation_required? }
    go_to_state :complete
    remove_transition :from => :delivery, :to => :confirm
  end
end
</ruby>

For more information about customizing the checkout process within Spree, please see the "Checkout guide":http://guides.spreecommerce.com/checkout.html.

h3. Minor changes
<commit_msg>Mention re-definition of has_role?, api_key and roles methods<commit_after>h2. Spree 1.2.0 Release Notes

Spree 1.2.0 introduces some fairly major changes in the basic architecture of Spree, as well as minor alterations and bugfixes.

Due to the long development cycle of Spree 1.2 in parallel with continuing development of the 1.1 branch, there may be features released in 1.2 that are already present in 1.1.

endprologue.

h3. Summary

There were two major addressed within this release of Spree: custom authentication and better checkout customization.

The first was the ability to use Spree in conjunction with an application that already provided its own way to authenticate users. Due to how Spree was architected in the past, this was not as easy as it could have been. In this release of Spree, the auth component of Spree has been removed completely and placed into a separate extension called "spree_auth_devise":https://github.com/spree/spree_auth_devise. If you wish to continue using this component of Spree, you will need to specify this extension as a dependency in your Gemfile. See "Issue #1512":https://github.com/spree/spree/pull/1512 for more detail about the customization.

The checkout process has always been hard to customize within Spree, and that has generated complaints in the past. We are pleased to report in the 1.2 release of Spree that this has been substaintially easier with a new checkout DSL that allows you to re-define the checkout steps in a simple manner. For more information about this, please see "Issue #1418":https://github.com/spree/spree/pull/1418 and "Issue #1743":https://github.com/spree/spree/pull/1743.

Along with these two major issues, there were also a ton of minor improvements and bug fixes, explained in detail below.

h3. Major changes (backwards incompatibility)

h4. spree_auth removal

Authentication is disabled by default within Spree as of this release, with the application supposed to be providing its own authentication. If you have an application that depended on this functionality within Spree existing, please add "spree_auth_devise":https://github.com/spree/spree_auth_devise to your Gemfile and then put this line inside +config/initializers/spree.rb+ as well:

<ruby>
Spree.user_class = "Spree::User"
</ruby>

For more information, please see the "Authentication guide":http://guides.spreecommerce.com/authentication.html.

h4. State machine customizations

Customizing the state machine within Spree now does not require you to override the entire +state_machine+ definition within Spree's +Order+ model. Instead, you are provided with the ability to define the "next" events for +Order+ objects like this:

<ruby>
Spree::Order.class_eval do
  checkout_flow do
    go_to_state :address
    go_to_state :delivery
    go_to_state :payment, :if => lambda { payment_required? }
    go_to_state :confirm, :if => lambda { confirmation_required? }
    go_to_state :complete
    remove_transition :from => :delivery, :to => :confirm
  end
end
</ruby>

For more information about customizing the checkout process within Spree, please see the "Checkout guide":http://guides.spreecommerce.com/checkout.html.

h3. Minor changes

h4. has_role?, api_key and roles methods now namespaced

On a usr object, the +has_role?+ method is now called +has_spree_role?+, the +api_key+ method is called +spree_api_key+ and the +roles+ association is now called +spree_roles+. This allows for applications to define their own +has_role?+, +api_key+ and +roles+ methods without them conflicting with the methods defined within Spree.

{'fraction_non_alphanumeric': 0.061136667161299896, 'fraction_numerical': 0.013800267101943908, 'mean_word_length': 4.745950554134698, 'pattern_counts': {'":': 14, '<': 11, '<?xml version=': 0, '>': 19, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1202075', 'n_tokens_mistral': 1885, 'n_tokens_neox': 1799, 'n_words': 890}