radiant-shop-extension 0.93.3 → 0.94.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.93.3
1
+ 0.94.0
@@ -23,7 +23,7 @@ class ShopCategory < ActiveRecord::Base
23
23
  def url; page.url; end
24
24
 
25
25
  # Returns the url of the page formatted as an sku
26
- def handle; ShopProduct.to_sku(page.url); end
26
+ def handle; ShopProduct.to_sku(slug); end
27
27
 
28
28
  # Returns the content of the product's page's description part
29
29
  def description
@@ -22,7 +22,7 @@ class ShopProduct < ActiveRecord::Base
22
22
  def name; page.title; end
23
23
 
24
24
  # Returns the url of the page formatted as an sku
25
- def sku; self.class.to_sku(url) end
25
+ def sku; ShopProduct.to_sku(slug); end
26
26
 
27
27
  # Returns the url of the product's page
28
28
  def url; page.url; end
@@ -4,7 +4,7 @@ module Shop
4
4
 
5
5
  def self.included(base)
6
6
  base.class_eval do
7
- before_filter :current_shop_order
7
+ #before_filter :current_shop_order
8
8
  end
9
9
  end
10
10
  end
@@ -145,20 +145,23 @@ module Shop
145
145
 
146
146
  def current_order(tag)
147
147
  result = nil
148
+ begin
149
+ if tag.attr['key'] and tag.attr['value']
150
+ result = ShopOrder.first(:conditions => { tag.attr['key'].downcase.to_sym => tag.attr['value'] })
148
151
 
149
- if tag.attr['key'] and tag.attr['value']
150
- result = ShopOrder.first(:conditions => { tag.attr['key'].downcase.to_sym => tag.attr['value'] })
151
-
152
- elsif tag.locals.shop_order.present?
153
- result = tag.locals.shop_order
152
+ elsif tag.locals.shop_order.present?
153
+ result = tag.locals.shop_order
154
154
 
155
- elsif tag.locals.page.request.session[:shop_order].present?
156
- session = tag.locals.page.request.session[:shop_order]
157
- result = ShopOrder.find(session)
155
+ elsif tag.locals.page.request.session[:shop_order].present?
156
+ session = tag.locals.page.request.session[:shop_order]
157
+ result = ShopOrder.find(session)
158
158
 
159
- elsif tag.locals.response.present? and tag.locals.response.result[:checkout].present?
160
- result = ShopOrder.find(tag.locals.response.result[:checkout][:order])
159
+ elsif tag.locals.response.present? and tag.locals.response.result[:checkout].present?
160
+ result = ShopOrder.find(tag.locals.response.result[:checkout][:order])
161
161
 
162
+ end
163
+ rescue
164
+ result = nil
162
165
  end
163
166
 
164
167
  result
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{radiant-shop-extension}
8
- s.version = "0.93.3"
8
+ s.version = "0.94.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dirk Kelly", "John Barker", "Darcy Laycock"]
12
- s.date = %q{2011-01-07}
12
+ s.date = %q{2011-01-11}
13
13
  s.description = %q{Radiant Shop is an attempt at a simple but complete store. It includes Products, Categories, Orders and Credit Card Payments}
14
14
  s.email = %q{dk@dirkkelly.com}
15
15
  s.extra_rdoc_files = [
@@ -57,7 +57,7 @@ describe ShopCategory do
57
57
 
58
58
  context '#handle' do
59
59
  it 'should return a handle formatted url' do
60
- @category.handle.should === ShopProduct.to_sku(@category.page.url)
60
+ @category.handle.should === ShopProduct.to_sku(@category.page.slug)
61
61
  end
62
62
  end
63
63
 
@@ -78,7 +78,7 @@ describe ShopProduct do
78
78
 
79
79
  context '#sku' do
80
80
  it 'should return a handle formatted url' do
81
- @product.sku.should === ShopProduct.to_sku(@product.page.url)
81
+ @product.sku.should === ShopProduct.to_sku(@product.page.slug)
82
82
  end
83
83
  end
84
84
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiant-shop-extension
3
3
  version: !ruby/object:Gem::Version
4
- hash: 365
4
+ hash: 359
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 93
9
- - 3
10
- version: 0.93.3
8
+ - 94
9
+ - 0
10
+ version: 0.94.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dirk Kelly
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-01-07 00:00:00 +08:00
20
+ date: 2011-01-11 00:00:00 +08:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency