spree_wholesale 0.40.0.beta2.3 → 0.40.0.beta3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -19,7 +19,7 @@ Install from the source:
19
19
  Or install the (beta) gem:
20
20
 
21
21
  gem install spree_wholesale --pre
22
- echo "gem 'spree_wholesale', '0.40.0.beta2'" >> Gemfile
22
+ echo "gem 'spree_wholesale', '0.40.0.beta3'" >> Gemfile
23
23
 
24
24
  rake spree_wholesale:install
25
25
  rake db:migrate
@@ -40,19 +40,64 @@ If you'd like run tests, install from the source, then run:
40
40
  (TO DO: Write some more tests!)
41
41
 
42
42
 
43
+ Demo
44
+ ----
43
45
 
44
- License
45
- -------
46
+ To create a demo of SpreeWholesaleExample
47
+
48
+ cd ~/your/project/directory
49
+
50
+ rails new spree_wholesale_example
51
+ cd spree_wholesale_example
52
+
53
+ echo "gem 'spree', '0.40.0'" >> Gemfile
54
+ echo "gem 'spree_wholesale', '0.40.0.beta3'" >> Gemfile
55
+ rm public/index.html
56
+
57
+ bundle install
58
+
59
+ rails g spree:site
60
+ rake spree:install
61
+ rake spree_wholesale:install
62
+ rake db:migrate
63
+ rake db:seed
64
+ rake spree_wholesale:create_role
65
+
66
+ or shorthand:
67
+
68
+ rails new spree_wholesale_example; cd spree_wholesale_example; echo "gem 'spree', '0.40.0'" >> Gemfile; echo "gem 'spree_wholesale', '0.40.0.beta2.3'" >> Gemfile; rm public/index.html
69
+ rake spree:install spree_wholesale:install db:migrate db:seed spree_wholesale:create_role
70
+
71
+ If you want sample data:
72
+
73
+ rake spree_sample:install db:sample
74
+ rake spree_wholesale:assume_wholesale_prices
46
75
 
47
- Copyright (c) 2011 Spencer Steffen, released under the New BSD License
48
- All rights reserved.
49
76
 
50
- >Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
51
77
 
52
- > Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
78
+ Link the included stylesheet by adding `@import url('wholesale.css');` to `screen.css`.
53
79
 
54
- > Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution.
80
+ echo "@import url('wholesale.css');"|cat - public/stylesheets/screen.css > /tmp/out && mv /tmp/out public/stylesheets/screen.css
81
+
82
+
83
+
84
+ Then finish by booting up the rails server:
85
+
86
+ rails s
87
+
88
+
89
+ All in one swoop:
90
+
91
+ rails new spree_wholesale_example; cd spree_wholesale_example; echo "gem 'spree', '0.40.0'" >> Gemfile; echo "gem 'spree_wholesale', '0.40.0.beta2.3'" >> Gemfile; rm public/index.html; bundle install; rake spree:install spree_wholesale:install db:migrate db:seed spree_wholesale:create_role spree_sample:install db:sample spree_wholesale:assume_wholesale_prices; echo "@import url('wholesale.css');"|cat - public/stylesheets/screen.css > /tmp/out && mv /tmp/out public/stylesheets/screen.css; rails s
92
+
55
93
 
56
- > Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
57
94
 
58
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
95
+ Once the server has loaded add the wholesaler role to your wholesale user(s). Navigate back to the store and check the prices!
96
+
97
+
98
+
99
+
100
+ License
101
+ -------
102
+
103
+ Copyright (c) 2011 Spencer Steffen, released under the New BSD License All rights reserved.
@@ -0,0 +1,8 @@
1
+ ApplicationHelper.module_eval do
2
+
3
+
4
+ def wholesaler_signed_in?
5
+ current_user && current_user.has_role?("wholesaler")
6
+ end
7
+
8
+ end
@@ -1,6 +1,6 @@
1
1
  class AddWholesalePriceToVariants < ActiveRecord::Migration
2
2
  def self.up
3
- add_column :variants, :wholesale_price, :decimal, :precision => 8, :scale => 2, :null => false
3
+ add_column :variants, :wholesale_price, :decimal, :precision => 8, :scale => 2, :null => false, :default => 0.0
4
4
  end
5
5
 
6
6
  def self.down
metadata CHANGED
@@ -6,9 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 40
8
8
  - 0
9
- - beta2
10
- - 3
11
- version: 0.40.0.beta2.3
9
+ - beta3
10
+ version: 0.40.0.beta3
12
11
  platform: ruby
13
12
  authors:
14
13
  - Spencer Steffen
@@ -66,6 +65,7 @@ files:
66
65
  - lib/tasks/install.rake
67
66
  - lib/tasks/spree_wholesale.rake
68
67
  - app/controllers/admin/orders_controller_decorator.rb
68
+ - app/models/application_controller_decorator.rb
69
69
  - app/models/line_item_decorator.rb
70
70
  - app/models/order_decorator.rb
71
71
  - app/models/product_decorator.rb