spree/spree — pull request #4695 by vishalzambre (2014-05-16 04:20:16+00:00)
Title: Coupon applicator changes

if promotion having coupon code and action is create line item, then after perform action
```ruby
promotion.activate(:coupon_code => @order.coupon_code, :order => @order)
```
we are not making any entry to adjustments for that order.
then in following code promo will always nil but that promotion is applies if eligible.
```ruby
promo = @order.adjustments.includes(:originator).promotion.detect { |p| p.originator.promotion.code == @order.coupon_code }
```
then it returns message
```ruby
return { :coupon_applied? => false, :error => Spree.t(:coupon_code_not_found) }
```
I check this with spreecommerce live demo as well it is reproducible
steps
1) go to => https://monster-boutique-2583.spree.mx/products/ruby-on-rails-baseball-jersey
2) click add to cart
3) go to => https://monster-boutique-2583.spree.mx/cart
4) use coupon code => "promotest"
5) click update
6) then you will see "Ruby on Rails Stein" this product in cart with flash message "The coupon code you entered doesn't exist. Please try again."

![screen shot 2014-05-14 at 3 56 39 pm](https://cloud.githubusercontent.com/assets/2970724/2993320/cdea05de-dcb0-11e3-8f95-2fbbab38cc66.png)

promotion screens

![screen shot 2014-05-14 at 3 57 38 pm](https://cloud.githubusercontent.com/assets/2970724/2993322/d33a53c2-dcb0-11e3-95ab-bac455cf306f.png)
![screen shot 2014-05-14 at 3 57 47 pm](https://cloud.githubusercontent.com/assets/2970724/2993323/d35c5d32-dcb0-11e3-8416-c76586fdabfa.png)