Permalink
Browse files

make compatible with spree 1.2.0

  • Loading branch information...
1 parent 50288ce commit dabbdc42e25fd59e4ac50c31a47751dd70ddb01a @salemine salemine committed Nov 19, 2012
Showing with 10 additions and 9 deletions.
  1. +2 −2 app/models/spree/user_decorator.rb
  2. +6 −3 app/models/spree/wishlist.rb
  3. +0 −1 lib/spree_wishlist.rb
  4. +2 −3 spree_wishlist.gemspec
@@ -1,5 +1,5 @@
-Spree::User.class_eval do
- has_many :wishlists
+Spree.user_class.class_eval do
+ has_many :wishlists, :class_name => Spree::Wishlist
def wishlist
default_wishlist = self.wishlists.first(:conditions => ["is_default = ?", true])
@@ -1,5 +1,6 @@
class Spree::Wishlist < ActiveRecord::Base
- belongs_to :user
+ belongs_to :user, :class_name => Spree.user_class
+
has_many :wished_products
before_create :set_access_hash
@@ -39,6 +40,8 @@ def is_public?
private
def set_access_hash
- self.access_hash = Digest::SHA1.hexdigest("--#{user_id}--#{user.password_salt}--#{Time.now}--")
- end
+ random_string = SecureRandom::hex(16)
+ self.access_hash = Digest::SHA1.hexdigest("--#{user_id}--#{random_string}--#{Time.now}--")
+ end
+
end
View
@@ -1,3 +1,2 @@
require 'spree_core'
-require 'spree_auth'
require 'spree_wishlist/engine'
View
@@ -16,10 +16,9 @@ Gem::Specification.new do |s|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.require_paths = ["lib"]
- s.add_dependency 'spree_core', '>= 1.1.0'
- s.add_dependency 'spree_auth', '>= 1.1.0'
+ s.add_dependency 'spree_core', '>= 1.2.0'
s.add_development_dependency 'factory_girl', '2.6.4'
- s.add_development_dependency 'rspec-rails', '~> 2.9.0'
+ s.add_development_dependency 'rspec-rails', '~> 2.11.0'
s.add_development_dependency 'sqlite3', '~> 1.3.5'
end

0 comments on commit dabbdc4

Please sign in to comment.