spree_reviews_rating 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -9,7 +9,7 @@ Basic Installation
9
9
 
10
10
  1. Add the following to your Gemfile
11
11
  <pre>
12
- gem 'spree_reviews_rating', '~> 1.1.1'
12
+ gem 'spree_reviews_rating', '~> 1.2.0'
13
13
  </pre>
14
14
  2. Run `bundle install`
15
15
  3. To copy and apply migrations run:
@@ -3,7 +3,7 @@ class Spree::AbilityDecorator
3
3
 
4
4
  def initialize(user)
5
5
  can :create, Spree::Review do |review|
6
- user.has_role?(:user) || !Spree::Config[:require_login]
6
+ user.has_spree_role?(:user) || !Spree::Config[:require_login]
7
7
  end
8
8
  can :read, Spree::Review
9
9
  end
@@ -1,7 +1,7 @@
1
- Spree::User.class_eval do
1
+ Spree.user_class.class_eval do
2
2
  before_create :set_role
3
3
 
4
4
  def set_role
5
- self.role_ids = Spree::Role.find_by_name("user").id
5
+ self.spree_role_ids = Spree::Role.find_or_create_by_name("user").id
6
6
  end
7
7
  end
@@ -13,6 +13,9 @@ module SpreeReviewsRating
13
13
 
14
14
  def add_javascripts
15
15
  append_file "app/assets/javascripts/store/all.js", "//= require store/spree_reviews_rating\n"
16
+ append_file "app/assets/javascripts/store/all.js", "// Added as part of the spree_reviews_rating install\n"
17
+ append_file "app/assets/javascripts/store/all.js", "//= require store/review/index\n"
18
+ append_file "app/assets/javascripts/store/all.js", "//= require store/review/new\n"
16
19
  end
17
20
 
18
21
  def add_stylesheets
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_reviews_rating
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-22 00:00:00.000000000 Z
12
+ date: 2012-10-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: spree_core