spree_suppliers 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  class Supplier < ActiveRecord::Base
2
2
  has_many :images, :as => :viewable, :order => :position, :dependent => :destroy
3
3
  accepts_nested_attributes_for :images
4
- has_one :user
4
+ belongs_to :user
5
5
  has_many :supplier_invoices
6
6
  has_and_belongs_to_many :taxons
7
7
  has_many :products
@@ -182,7 +182,7 @@ module SpreeSuppliers
182
182
  end
183
183
 
184
184
  User.class_eval do
185
- belongs_to :supplier
185
+ has_one :supplier
186
186
  end
187
187
 
188
188
  end
@@ -0,0 +1,6 @@
1
+ FactoryGirl.define do
2
+ factory :supplier do
3
+ name 'Testy Sir'
4
+ title 'Thomas the Train'
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ require 'spec_helper'
2
+
3
+ describe InvoiceItem do
4
+ it { should belong_to(:supplier_invoice) }
5
+ it { should belong_to(:line_item)}
6
+ end
@@ -0,0 +1,6 @@
1
+ require 'spec_helper'
2
+
3
+ describe SupplierInvoice do
4
+ it { should belong_to(:supplier) }
5
+ it { should have_many(:invoice_items) }
6
+ end
@@ -0,0 +1,10 @@
1
+ require 'spec_helper'
2
+
3
+ describe Supplier do
4
+
5
+ it { should belong_to(:user) }
6
+ it { should have_many(:supplier_invoices) }
7
+ it { should have_many(:images) }
8
+ it { should have_many(:products) }
9
+
10
+ end
Binary file
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |s|
3
3
  s.platform = Gem::Platform::RUBY
4
4
  s.name = 'spree_suppliers'
5
- s.version = '1.0.2'
5
+ s.version = '1.0.3'
6
6
  s.summary = 'This gem adds multiple suppliers to spree, with the ability to associate products with suppliers. Suppliers can be managed from the Admin interface.'
7
7
  s.description = 'This gem (spree extension) provides support for multiple suppliers in one store. Products should be assigned to the supplier that they belong to, which allows you to select a supplier and view only their products. Suppliers can be associated with Taxons that allow the customer to search for suppliers by taxon. Orders are also broken up into supplier invoices (one for each different supplier in the order), which list only the products that were purchased from that supplier. A mailer is in place to send each supplier their unique invoice descrbing what products they have sold and to who. The spree order mailer has also been modified to show all of the supplier invoices to the customer, along with the standard spree order number and info. The checkout process is combined so the customer only makes one transaction - the transaction can then be divided up amongst the suppliers involved in the transaction, according to the supplier_invoices. There is also an option for the site administrator to charge a percentage fee on each transaction to suppliers (this is currently set to 0%, but can be changed).'
8
8
 
@@ -20,5 +20,11 @@ Gem::Specification.new do |s|
20
20
 
21
21
  s.add_dependency 'spree_core', '>= 0.70.3'
22
22
  s.add_development_dependency 'rspec-rails'
23
+ s.add_development_dependency 'cucumber-rails'
24
+ s.add_development_dependency 'capybara'
25
+ s.add_development_dependency 'database_cleaner'
26
+ s.add_development_dependency 'nokogiri'
27
+ s.add_development_dependency 'shoulda'
28
+
23
29
  end
24
30
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: spree_suppliers
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.2
5
+ version: 1.0.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - JD Warren and Han Dao
@@ -34,6 +34,61 @@ dependencies:
34
34
  version: "0"
35
35
  type: :development
36
36
  version_requirements: *id002
37
+ - !ruby/object:Gem::Dependency
38
+ name: cucumber-rails
39
+ prerelease: false
40
+ requirement: &id003 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: "0"
46
+ type: :development
47
+ version_requirements: *id003
48
+ - !ruby/object:Gem::Dependency
49
+ name: capybara
50
+ prerelease: false
51
+ requirement: &id004 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: "0"
57
+ type: :development
58
+ version_requirements: *id004
59
+ - !ruby/object:Gem::Dependency
60
+ name: database_cleaner
61
+ prerelease: false
62
+ requirement: &id005 !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ type: :development
69
+ version_requirements: *id005
70
+ - !ruby/object:Gem::Dependency
71
+ name: nokogiri
72
+ prerelease: false
73
+ requirement: &id006 !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: "0"
79
+ type: :development
80
+ version_requirements: *id006
81
+ - !ruby/object:Gem::Dependency
82
+ name: shoulda
83
+ prerelease: false
84
+ requirement: &id007 !ruby/object:Gem::Requirement
85
+ none: false
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: "0"
90
+ type: :development
91
+ version_requirements: *id007
37
92
  description: This gem (spree extension) provides support for multiple suppliers in one store. Products should be assigned to the supplier that they belong to, which allows you to select a supplier and view only their products. Suppliers can be associated with Taxons that allow the customer to search for suppliers by taxon. Orders are also broken up into supplier invoices (one for each different supplier in the order), which list only the products that were purchased from that supplier. A mailer is in place to send each supplier their unique invoice descrbing what products they have sold and to who. The spree order mailer has also been modified to show all of the supplier invoices to the customer, along with the standard spree order number and info. The checkout process is combined so the customer only makes one transaction - the transaction can then be divided up amongst the suppliers involved in the transaction, according to the supplier_invoices. There is also an option for the site administrator to charge a percentage fee on each transaction to suppliers (this is currently set to 0%, but can be changed).
38
93
  email: jd@isotope11.com
39
94
  executables: []
@@ -134,7 +189,12 @@ files:
134
189
  - lib/spree_suppliers/engine.rb
135
190
  - lib/spree_suppliers_hooks.rb
136
191
  - script/rails
192
+ - spec/factories/suppliers.rb
193
+ - spec/models/invoice_item_spec.rb
194
+ - spec/models/supplier_invoice_spec.rb
195
+ - spec/models/supplier_spec.rb
137
196
  - spec/spec_helper.rb
197
+ - spree_suppliers-1.0.2.gem
138
198
  - spree_suppliers.gemspec
139
199
  - test/fixtures/.gitkeep
140
200
  - test/fixtures/invoice_items.yml
@@ -176,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
236
  requirements:
177
237
  - none
178
238
  rubyforge_project: spree_suppliers
179
- rubygems_version: 1.8.12
239
+ rubygems_version: 1.8.15
180
240
  signing_key:
181
241
  specification_version: 3
182
242
  summary: This gem adds multiple suppliers to spree, with the ability to associate products with suppliers. Suppliers can be managed from the Admin interface.