ajaxful_rating 3.0.0.beta4 → 3.0.0.beta6

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,12 @@
1
+ == 3.0.0.beta6 August 23, 2011
2
+ * Move validation to Rate model
3
+
4
+ == 3.0.0.beta5 August 23, 2011
5
+ * Validate minimum of stars
6
+
7
+ == 3.0.0.beta4 August 16, 2011
8
+ * Allow configuration per dimension
9
+
1
10
  == 3.0.0.beta2 August 8, 2010
2
11
  * Fix dom_class and tap methods in rails.rc
3
12
 
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ begin
6
6
 
7
7
  Jeweler::Tasks.new do |spec|
8
8
  spec.name = "ajaxful_rating"
9
- spec.version = "3.0.0.beta4"
9
+ spec.version = "3.0.0.beta6"
10
10
  spec.summary = "Provides a simple way to add rating functionality to your application."
11
11
  spec.description = "Provides a simple way to add rating functionality to your application."
12
12
  spec.homepage = "http://github.com/edgarjs/ajaxful-rating"
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ajaxful_rating}
8
- s.version = "3.0.0.beta4"
8
+ s.version = "3.0.0.beta6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Edgar J. Suarez", "Denis Odorcic"]
12
- s.date = %q{2011-08-16}
12
+ s.date = %q{2011-08-23}
13
13
  s.description = %q{Provides a simple way to add rating functionality to your application.}
14
14
  s.email = ["edgar.js@gmail.com", "denis.odorcic@gmail.com"]
15
15
  s.extra_rdoc_files = [
data/lib/axr/model.rb CHANGED
@@ -78,7 +78,7 @@ module AjaxfulRating # :nodoc:
78
78
  # # some page update here ...
79
79
  # end
80
80
  def rate(stars, user, dimension = nil)
81
- return false if (stars.to_i > self.class.max_stars)
81
+ return false if (stars.to_i > self.class.max_stars) || (stars.to_i < 1)
82
82
  raise Errors::AlreadyRatedError if (!self.class.axr_config(dimension)[:allow_update] && rated_by?(user, dimension))
83
83
 
84
84
  rate = if self.class.axr_config(dimension)[:allow_update] && rated_by?(user, dimension)
@@ -1,6 +1,7 @@
1
1
  class Rate < ActiveRecord::Base
2
2
  belongs_to :rater, :class_name => "<%= file_name.classify %>"
3
3
  belongs_to :rateable, :polymorphic => true
4
+ validates_numericality_of :stars, :minimum => 1
4
5
 
5
6
  attr_accessible :rate, :dimension
6
7
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ajaxful_rating
3
3
  version: !ruby/object:Gem::Version
4
- hash: 62196427
4
+ hash: 62196431
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
9
  - 0
10
10
  - beta
11
- - 4
12
- version: 3.0.0.beta4
11
+ - 6
12
+ version: 3.0.0.beta6
13
13
  platform: ruby
14
14
  authors:
15
15
  - Edgar J. Suarez
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2011-08-16 00:00:00 -05:00
21
+ date: 2011-08-23 00:00:00 -05:00
22
22
  default_executable:
23
23
  dependencies: []
24
24