ajaxful_rating 2.2.2 → 2.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ == 2.2.3 March 10, 2010
2
+ * Fix validation of current_user to show linked stars
3
+
1
4
  == 2.2.2 March 9, 2010
2
5
  * Fix bug for jRuby
3
6
  * Fixed user self relational model to be rater and rateable.
data/Manifest CHANGED
@@ -2,7 +2,6 @@ CHANGELOG
2
2
  Manifest
3
3
  README.textile
4
4
  Rakefile
5
- ajaxful_rating.gemspec
6
5
  generators/ajaxful_rating/USAGE
7
6
  generators/ajaxful_rating/ajaxful_rating_generator.rb
8
7
  generators/ajaxful_rating/templates/images/star.png
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('ajaxful_rating', '2.2.2') do |p|
5
+ Echoe.new('ajaxful_rating', '2.2.3') do |p|
6
6
  p.description = "Provides a simple way to add rating functionality to your application."
7
7
  p.url = "http://github.com/edgarjs/ajaxful-rating"
8
8
  p.author = "Edgar J. Suarez"
@@ -2,15 +2,15 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{ajaxful_rating}
5
- s.version = "2.2.2"
5
+ s.version = "2.2.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Edgar J. Suarez"]
9
- s.date = %q{2010-03-09}
9
+ s.date = %q{2010-03-10}
10
10
  s.description = %q{Provides a simple way to add rating functionality to your application.}
11
11
  s.email = %q{edgar.js@gmail.com}
12
12
  s.extra_rdoc_files = ["CHANGELOG", "README.textile", "lib/ajaxful_rating.rb", "lib/axr/css_builder.rb", "lib/axr/errors.rb", "lib/axr/helpers.rb", "lib/axr/locale.rb", "lib/axr/model.rb", "lib/axr/stars_builder.rb"]
13
- s.files = ["CHANGELOG", "Manifest", "README.textile", "Rakefile", "ajaxful_rating.gemspec", "generators/ajaxful_rating/USAGE", "generators/ajaxful_rating/ajaxful_rating_generator.rb", "generators/ajaxful_rating/templates/images/star.png", "generators/ajaxful_rating/templates/images/star_small.png", "generators/ajaxful_rating/templates/migration.rb", "generators/ajaxful_rating/templates/model.rb", "generators/ajaxful_rating/templates/style.css", "init.rb", "lib/ajaxful_rating.rb", "lib/axr/css_builder.rb", "lib/axr/errors.rb", "lib/axr/helpers.rb", "lib/axr/locale.rb", "lib/axr/model.rb", "lib/axr/stars_builder.rb"]
13
+ s.files = ["CHANGELOG", "Manifest", "README.textile", "Rakefile", "generators/ajaxful_rating/USAGE", "generators/ajaxful_rating/ajaxful_rating_generator.rb", "generators/ajaxful_rating/templates/images/star.png", "generators/ajaxful_rating/templates/images/star_small.png", "generators/ajaxful_rating/templates/migration.rb", "generators/ajaxful_rating/templates/model.rb", "generators/ajaxful_rating/templates/style.css", "init.rb", "lib/ajaxful_rating.rb", "lib/axr/css_builder.rb", "lib/axr/errors.rb", "lib/axr/helpers.rb", "lib/axr/locale.rb", "lib/axr/model.rb", "lib/axr/stars_builder.rb", "ajaxful_rating.gemspec"]
14
14
  s.homepage = %q{http://github.com/edgarjs/ajaxful-rating}
15
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Ajaxful_rating", "--main", "README.textile"]
16
16
  s.require_paths = ["lib"]
data/lib/axr/helpers.rb CHANGED
@@ -75,7 +75,7 @@ module AjaxfulRating # :nodoc:
75
75
  def ratings_for(*args)
76
76
  @axr_css ||= CSSBuilder.new
77
77
  options = args.extract_options!.symbolize_keys.slice(:small, :remote_options,
78
- :wrap, :show_user_rating, :dimension, :force_static)
78
+ :wrap, :show_user_rating, :dimension, :force_static, :current_user)
79
79
  remote_options = options.delete(:remote_options) || {}
80
80
  rateable = args.shift
81
81
  user = args.shift || (respond_to?(:current_user) ? current_user : raise(NoUserSpecified))
@@ -30,7 +30,8 @@ module AjaxfulRating # :nodoc:
30
30
  :wrap => true,
31
31
  :small => false,
32
32
  :show_user_rating => false,
33
- :force_static => false
33
+ :force_static => false,
34
+ :current_user => (@template.current_user if @template.respond_to?(:current_user))
34
35
  }.merge(options)
35
36
 
36
37
  @options[:small] = @options[:small].to_s == 'true'
@@ -76,9 +77,9 @@ module AjaxfulRating # :nodoc:
76
77
  :width => "#{(value / rateable.class.max_stars.to_f) * 100}%",
77
78
  :zIndex => (rateable.class.max_stars + 2 - value).to_s
78
79
  })
79
-
80
80
  @template.content_tag(:li) do
81
- if !options[:force_static] && (user && (!already_rated || rateable.axr_config[:allow_update]))
81
+ if !options[:force_static] && (user && options[:current_user] == user &&
82
+ (!already_rated || rateable.axr_config[:allow_update]))
82
83
  link_star_tag(value, css_class)
83
84
  else
84
85
  @template.content_tag(:span, show_value, :class => css_class, :title => i18n(:current))
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 2
8
- - 2
9
- version: 2.2.2
8
+ - 3
9
+ version: 2.2.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Edgar J. Suarez
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-03-09 00:00:00 -06:00
17
+ date: 2010-03-10 00:00:00 -06:00
18
18
  default_executable:
19
19
  dependencies: []
20
20
 
@@ -39,7 +39,6 @@ files:
39
39
  - Manifest
40
40
  - README.textile
41
41
  - Rakefile
42
- - ajaxful_rating.gemspec
43
42
  - generators/ajaxful_rating/USAGE
44
43
  - generators/ajaxful_rating/ajaxful_rating_generator.rb
45
44
  - generators/ajaxful_rating/templates/images/star.png
@@ -55,6 +54,7 @@ files:
55
54
  - lib/axr/locale.rb
56
55
  - lib/axr/model.rb
57
56
  - lib/axr/stars_builder.rb
57
+ - ajaxful_rating.gemspec
58
58
  has_rdoc: true
59
59
  homepage: http://github.com/edgarjs/ajaxful-rating
60
60
  licenses: []