Skip to content

Commit

Permalink
Remove and move most stuff to spree_marketplace.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Dutil authored and Jeff Dutil committed Apr 28, 2014
1 parent b4d74d6 commit 4cdf478
Show file tree
Hide file tree
Showing 18 changed files with 8 additions and 868 deletions.
4 changes: 0 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ group :development, :test do
spree_branch = 'master'
gem 'spree', github: 'spree/spree', branch: spree_branch
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: spree_branch
gem 'spree_digital', github: 'halo/spree_digital', branch: spree_branch
gem 'spree_editor', github: 'spree/spree_editor', branch: spree_branch
gem 'spree_group_pricing', github: 'jdutil/spree_group_pricing', branch: spree_branch
gem 'spree_related_products', github: 'spree/spree_related_products', branch: spree_branch
end

gemspec
15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,6 @@ within the email where they are prompted to confirm the shipment.
Spree Drop Ship used with [Spree Marketplace](https://github.com/jdutil/spree_marketplace) allows handling payments to your suppliers via ACH direct deposits.
This is still currently a work in progress, and any input is welcome.

Integrations
------------

Spree Drop Ship will support several other Spree extensions being used by scoping information by supplier.

Some extensions that can be used in conjunction with Spree Drop Ship:

* spree_digital
* spree_editor (assumes use of ckeditor & you should delete the generated models & initializer in your app to use spree_editors copies)
* spree_group_pricing
* spree_marketplace
* spree_related_products

Please Note: If you intend to use any of these extensions you should install them before installing spree_drop_ship so that spree_drop_ship's migrations are run last. You should also place spree_drop_ship AFTER all other extensions in your Gemfile.

Upgrading
---------

Expand Down
1 change: 0 additions & 1 deletion app/assets/javascripts/spree/frontend/spree_drop_ship.js
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
//= require spree/frontend
//= require_tree .
56 changes: 0 additions & 56 deletions app/assets/javascripts/spree/frontend/supplier_address.js.coffee

This file was deleted.

59 changes: 0 additions & 59 deletions app/controllers/spree/suppliers_controller.rb

This file was deleted.

6 changes: 5 additions & 1 deletion app/mailers/spree/drop_ship_order_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ class DropShipOrderMailer < Spree::BaseMailer
def supplier_order(shipment_id)
@shipment = Shipment.find shipment_id
@supplier = @shipment.supplier
mail to: @supplier.email, subject: Spree.t('drop_ship_order_mailer.supplier_order.subject', name: Spree::Store.current.site_name, number: @shipment.number)
puts Spree::Store.current.inspect
puts Spree::Store.current.mail_from_address
m = mail to: @supplier.email, subject: Spree.t('drop_ship_order_mailer.supplier_order.subject', name: Spree::Store.current.site_name, number: @shipment.number)
puts m.inspect
m
end

end
Expand Down
33 changes: 0 additions & 33 deletions app/models/spree/supplier_ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,7 @@ def initialize(user)
user ||= Spree.user_class.new

if user.supplier
if defined?(Spree::Digital)
can [:admin, :manage], Spree::Digital, variant: { product: { supplier_id: user.supplier_id } }
can :create, Spree::Digital
end
can [:admin, :manage], Spree::Image do |image|
image.viewable.product.supplier_id == user.supplier_id
end
can :create, Spree::Image
if defined?(Spree::GroupPrice)
can [:admin, :manage], Spree::GroupPrice, variant: { product: { supplier_id: user.supplier_id } }
end
if defined?(Spree::Relation)
can [:admin, :manage], Spree::Relation, relatable: { supplier_id: user.supplier_id }
end
can [:admin, :manage, :stock], Spree::Product, supplier_id: user.supplier_id
can :create, Spree::Product
can [:admin, :manage], Spree::ProductProperty, product: { supplier_id: user.supplier_id }
can [:admin, :index, :read], Spree::Property
can [:admin, :read], Spree::Prototype
can [:admin, :manage, :read, :ready, :ship], Spree::Shipment, order: { state: 'complete' }, stock_location: { supplier_id: user.supplier_id }
can [:admin, :create, :update], :stock_items
can [:admin, :manage], Spree::StockItem, variant: { product: { supplier_id: user.supplier_id } }
Expand All @@ -33,21 +15,6 @@ def initialize(user)
can [:admin, :manage], Spree::StockMovement, stock_item: { variant: { product: { supplier_id: user.supplier_id } } }
can :create, Spree::StockMovement
can [:admin, :update], Spree::Supplier, id: user.supplier_id
can [:admin, :manage], Spree::Variant, product: { supplier_id: user.supplier_id }
end

if SpreeDropShip::Config[:allow_signup]
can :create, Spree::Supplier
end

if defined?(Ckeditor)
can :access, :ckeditor

can :create, Ckeditor::AttachmentFile
can [:read, :index, :destroy], Ckeditor::AttachmentFile, supplier_id: user.supplier_id

can :create, Ckeditor::Picture
can [:read, :index, :destroy], Ckeditor::Picture, supplier_id: user.supplier_id
end

end
Expand Down
45 changes: 0 additions & 45 deletions app/views/spree/suppliers/new.html.erb

This file was deleted.

2 changes: 0 additions & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@
resources :suppliers
end

resources :suppliers, only: [:create, :new]

end
Loading

0 comments on commit 4cdf478

Please sign in to comment.