Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make compatible with spree 1.2.0

  • Loading branch information...
commit dabbdc42e25fd59e4ac50c31a47751dd70ddb01a 1 parent 50288ce
@salemine salemine authored
View
4 app/models/spree/user_decorator.rb
@@ -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])
View
9 app/models/spree/wishlist.rb
@@ -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  lib/spree_wishlist.rb
@@ -1,3 +1,2 @@
require 'spree_core'
-require 'spree_auth'
require 'spree_wishlist/engine'
View
5 spree_wishlist.gemspec
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.