Skip to content

Commit

Permalink
Revert "Merge pull request #1 from sherryson/subscription-mailers"
Browse files Browse the repository at this point in the history
This reverts commit 151e982, reversing
changes made to 56971fc.

undo merge from subscription-mailer to remove polluted commits
  • Loading branch information
sherryson committed May 18, 2016
1 parent 151e982 commit 532dc38
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 180 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.3
2.2
5 changes: 0 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ gem 'solidus', github: 'solidusio/solidus', branch: 'master'
gem 'solidus_auth_devise', github: 'solidusio/solidus_auth_devise', branch: 'master'
gem 'active_model_serializers', '~> 0.8.3'
gem 'stripe'
gem 'slim-rails'

group :test do
gem 'factory_girl', '4.5.0'
Expand All @@ -18,8 +17,4 @@ group :test do
gem 'simplecov', require: false
end

group :development do
gem 'letter_opener'
end

gemspec
23 changes: 1 addition & 22 deletions app/controllers/spree/api/subscriptions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ module Api
class SubscriptionsController < Spree::Api::BaseController
before_action :find_subscription, except: [:index]

def self.prepended(base)
base.prepend_after_action :deliver_cancellation_email, only: [:cancel]
base.prepend_after_action :deliver_pause_email, only: [:pause]
# need to touch user so the address list is updated
base.prepend_after_action :touch_user, only: [:update_address, :create_address, :select_address]
end

def index
render json: current_api_user.subscriptions,
root: false,
Expand All @@ -21,12 +14,10 @@ def show
end

def update
@previous_interval = @subscription.interval
result = @subscription.update_attributes(subscription_params)

if result
render json: @subscription.to_json
Spree::SubscriptionMailer.delay.updated(@subscription, @previous_interval)
render_subscription
else
invalid_resource!(@subscription)
end
Expand Down Expand Up @@ -122,18 +113,6 @@ def create_credit_card

private

def deliver_cancellation_email
Spree::SubscriptionMailer.cancel(@subscription).deliver_now
end

def deliver_pause_email
Spree::SubscriptionMailer.pause(@subscription).deliver_now
end

def touch_user
@subscription.user.touch
end

def render_subscription
render json: @subscription,
root: false,
Expand Down
36 changes: 0 additions & 36 deletions app/mailers/spree/subscription_mailer.rb

This file was deleted.

18 changes: 0 additions & 18 deletions app/services/adjust_sku_service.rb

This file was deleted.

6 changes: 0 additions & 6 deletions app/views/spree/subscription_mailer/cancel.slim

This file was deleted.

6 changes: 0 additions & 6 deletions app/views/spree/subscription_mailer/pause.slim

This file was deleted.

18 changes: 0 additions & 18 deletions app/views/spree/subscription_mailer/updated.slim

This file was deleted.

8 changes: 0 additions & 8 deletions config/environments/development.rb

This file was deleted.

60 changes: 0 additions & 60 deletions spec/services/adjust_sku_service_spec.rb

This file was deleted.

0 comments on commit 532dc38

Please sign in to comment.