spree_address_book 0.40.0 → 0.50.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -4,7 +4,13 @@ SpreeAddressBook
4
4
  This extension allows users select `bill_address` and `ship_address` from addresses, which was already entered by current user.
5
5
 
6
6
 
7
+ Installation
8
+ ============
7
9
 
10
+ Add `gem "spree_address_book", :git => "git://github.com/romul/spree_address_book.git"
11
+ Run `bundle install`
12
+ Run `rake spree_address_book:install`
13
+ Run `rake db:migrate`
8
14
 
9
15
 
10
16
  Copyright (c) 2011 Roman Smirnov, released under the New BSD License
data/Versionfile ADDED
@@ -0,0 +1,2 @@
1
+ "0.40.x" => { :branch => "0-40-stable" }
2
+ "0.50.x" => { :branch => "master" }
@@ -1,6 +1,14 @@
1
1
  Order.class_eval do
2
2
  attr_accessible :bill_address_id, :ship_address_id
3
-
3
+ before_validation :clone_shipping_address, :if => "Spree::Config[:disable_bill_address]"
4
+
5
+ def clone_shipping_address
6
+ if self.ship_address
7
+ self.bill_address = self.ship_address
8
+ end
9
+ true
10
+ end
11
+
4
12
  def clone_billing_address
5
13
  if self.bill_address
6
14
  self.ship_address = self.bill_address
@@ -6,11 +6,12 @@
6
6
  div#checkout #checkout_form_address #shipping .select_address label { float:none; }
7
7
  </style>
8
8
 
9
- <% ['billing', 'shipping'].each do |address_type| %>
10
- <% address_name = "#{address_type[0...4]}_address" %>
9
+ <% ['billing', 'shipping'].each do |address_type|
10
+ next if address_type == 'billing' && Spree::Config[:disable_bill_address]
11
+ address_name = "#{address_type[0...4]}_address" %>
11
12
  <fieldset id="<%= address_type %>">
12
13
  <legend><%= t(address_type + "_address")%></legend>
13
- <% if address_type == 'shipping' %>
14
+ <% if address_type == 'shipping' && !Spree::Config[:disable_bill_address] %>
14
15
  <p class="field checkbox">
15
16
  <label for="order_use_billing" id="use_billing">
16
17
  <%= check_box_tag 'order[use_billing]', '1', (!(@order.bill_address.empty? && @order.ship_address.empty?) && @order.bill_address.eql?(@order.ship_address)) %> <%= t("use_billing_address") %>
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.platform = Gem::Platform::RUBY
3
3
  s.name = 'spree_address_book'
4
- s.version = '0.40.0'
4
+ s.version = '0.50.0'
5
5
  s.summary = 'Adds address book for users to Spree'
6
6
  #s.description = 'Add (optional) gem description here'
7
7
  s.required_ruby_version = '>= 1.8.7'
@@ -16,8 +16,6 @@ Gem::Specification.new do |s|
16
16
  s.require_path = 'lib'
17
17
  s.requirements << 'none'
18
18
 
19
- s.has_rdoc = true
20
-
21
- s.add_dependency('spree_core', '>= 0.40.0')
22
- s.add_dependency('spree_auth', '>= 0.40.0')
19
+ s.add_dependency('spree_core', '>= 0.50.0')
20
+ s.add_dependency('spree_auth', '>= 0.50.0')
23
21
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 40
7
+ - 50
8
8
  - 0
9
- version: 0.40.0
9
+ version: 0.50.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Roman Smirnov
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-03-26 00:00:00 +03:00
17
+ date: 2011-04-28 00:00:00 +04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -26,9 +26,9 @@ dependencies:
26
26
  - !ruby/object:Gem::Version
27
27
  segments:
28
28
  - 0
29
- - 40
29
+ - 50
30
30
  - 0
31
- version: 0.40.0
31
+ version: 0.50.0
32
32
  type: :runtime
33
33
  version_requirements: *id001
34
34
  - !ruby/object:Gem::Dependency
@@ -40,9 +40,9 @@ dependencies:
40
40
  - !ruby/object:Gem::Version
41
41
  segments:
42
42
  - 0
43
- - 40
43
+ - 50
44
44
  - 0
45
- version: 0.40.0
45
+ version: 0.50.0
46
46
  type: :runtime
47
47
  version_requirements: *id002
48
48
  description:
@@ -58,6 +58,7 @@ files:
58
58
  - LICENSE
59
59
  - README.md
60
60
  - Rakefile
61
+ - Versionfile
61
62
  - app/controllers/addresses_controller.rb
62
63
  - app/controllers/checkout_controller_decorator.rb
63
64
  - app/models/address_decorator.rb