acts_rateable 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/lib/acts_rateable/acts_rateable.rb +14 -9
- data/lib/acts_rateable/count.rb +12 -18
- data/lib/acts_rateable/rate.rb +9 -7
- data/lib/acts_rateable/rating.rb +11 -17
- data/lib/acts_rateable/version.rb +1 -1
- metadata +13 -214
- data/test/acts_rateable_test.rb +0 -7
- data/test/dummy/README.rdoc +0 -261
- data/test/dummy/Rakefile +0 -7
- data/test/dummy/app/assets/javascripts/application.js +0 -15
- data/test/dummy/app/assets/stylesheets/application.css +0 -13
- data/test/dummy/app/controllers/application_controller.rb +0 -3
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/models/post.rb +0 -4
- data/test/dummy/app/models/user.rb +0 -4
- data/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/test/dummy/config.ru +0 -4
- data/test/dummy/config/application.rb +0 -59
- data/test/dummy/config/boot.rb +0 -10
- data/test/dummy/config/database.yml +0 -25
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -37
- data/test/dummy/config/environments/production.rb +0 -67
- data/test/dummy/config/environments/test.rb +0 -37
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/inflections.rb +0 -15
- data/test/dummy/config/initializers/mime_types.rb +0 -5
- data/test/dummy/config/initializers/secret_token.rb +0 -7
- data/test/dummy/config/initializers/session_store.rb +0 -8
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/dummy/config/locales/en.yml +0 -5
- data/test/dummy/config/routes.rb +0 -58
- data/test/dummy/coverage/assets/0.7.1/application.css +0 -1110
- data/test/dummy/coverage/assets/0.7.1/application.js +0 -626
- data/test/dummy/coverage/assets/0.7.1/fancybox/blank.gif +0 -0
- data/test/dummy/coverage/assets/0.7.1/fancybox/fancy_close.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/fancybox/fancy_loading.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/fancybox/fancy_nav_left.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/fancybox/fancy_nav_right.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_e.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_n.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_ne.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_nw.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_s.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_se.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_sw.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_w.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/fancybox/fancy_title_left.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/fancybox/fancy_title_main.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/fancybox/fancy_title_over.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/fancybox/fancy_title_right.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/fancybox/fancybox-x.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/fancybox/fancybox-y.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/fancybox/fancybox.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/favicon_green.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/favicon_red.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/favicon_yellow.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/loading.gif +0 -0
- data/test/dummy/coverage/assets/0.7.1/magnify.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/test/dummy/coverage/assets/0.7.1/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/test/dummy/coverage/index.html +0 -294
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20130520024319_create_posts.rb +0 -9
- data/test/dummy/db/migrate/20130520024332_create_users.rb +0 -9
- data/test/dummy/db/migrate/20130520163820_acts_rateable_migration.rb +0 -28
- data/test/dummy/db/schema.rb +0 -56
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +0 -606
- data/test/dummy/log/test.log +0 -3639
- data/test/dummy/public/404.html +0 -26
- data/test/dummy/public/422.html +0 -26
- data/test/dummy/public/500.html +0 -25
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +0 -6
- data/test/dummy/spec/factories/post.rb +0 -5
- data/test/dummy/spec/factories/user.rb +0 -5
- data/test/dummy/spec/models/acts_rateable_spec.rb +0 -102
- data/test/dummy/spec/spec_helper.rb +0 -51
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZTQ5YmFjMTJkNTkxZWI2ZmU5MTM1ZGFhMzczNjI5NDMyMDgwY2E2NA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZGJjY2NkYzRlMjE2OWNiYmU1ODFmOGYzZWYwMWJkMTc4OGQ2ZGY4OA==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZmUzMDg5NWNiZmNkMTAzNjFkNWZmMjZmZjg1ZGMwMDdkYTE3Y2FhMzQxM2Uz
|
10
|
+
ZWU3YmUzNWUzNTgyMWE0Nzc3MmUwNDA2OTIyZmYxNjc0MWY1ZTgwNjU0ZWE5
|
11
|
+
MDNkY2U5YWZlZWI5Yjk4YmRjMmE0Y2ZmZTc1ODMwZjVjNWU0MjI=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZDNlMDljMTExZTViMzhhODdkNmY1MjlkY2Q2YzU0OWQ2Y2ViY2YxYzkwMWZk
|
14
|
+
ZjhlZGM1ODA0ZmY3YWVmNGY5NWZjZGViMWQ0OTRjYzI5YzhlYjRkODQ5NjMx
|
15
|
+
YmI3NzAzNTI4NDE3MzFhY2Q1NDg1OGViYjZiZjAwMWUzNDk4ZDI=
|
@@ -7,27 +7,32 @@ module ActsRateable
|
|
7
7
|
module ClassMethods
|
8
8
|
|
9
9
|
def acts_rateable(options = {})
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
if (Rails::VERSION::STRING.to_f >= 4)
|
11
|
+
has_many :rates, ->(obj) { where(resource_type: obj.class.base_class.name) }, class_name: ActsRateable::Rate, foreign_key: :resource_id, dependent: :destroy
|
12
|
+
has_many :rated, ->(obj) { where(author_type: obj.class.base_class.name) }, class_name: ActsRateable::Rate, foreign_key: :author_id, dependent: :destroy
|
13
|
+
has_one :rating, ->(obj) { where(resource_type: obj.class.base_class.name) }, class_name: ActsRateable::Rating, foreign_key: :resource_id, dependent: :destroy
|
14
|
+
has_one :count, ->(obj) { where(resource_type: obj.class.base_class.name) }, class_name: ActsRateable::Count, foreign_key: :resource_id, dependent: :destroy
|
15
|
+
else
|
16
|
+
has_many :rates, class_name: ActsRateable::Rate, conditions: { resource_type: self.base_class.name }, foreign_key: :resource_id, dependent: :destroy
|
17
|
+
has_many :rated, class_name: ActsRateable::Rate, conditions: { author_type: self.base_class.name }, foreign_key: :author_id, dependent: :destroy
|
18
|
+
has_one :rating, class_name: ActsRateable::Rating, conditions: { resource_type: self.base_class.name }, foreign_key: :resource_id, dependent: :destroy
|
19
|
+
has_one :count, class_name: ActsRateable::Count, conditions: { resource_type: self.base_class.name }, foreign_key: :resource_id, dependent: :destroy
|
20
|
+
end
|
15
21
|
|
16
22
|
scope :order_by_rating, lambda { | column='estimate', direction="DESC" |
|
17
23
|
includes(:rating).group('ar_ratings.id').order("ar_ratings.#{column.downcase} #{direction.upcase}")
|
18
24
|
}
|
19
|
-
|
25
|
+
|
20
26
|
scope :order_by_count, lambda { | column='estimate', direction="DESC" |
|
21
27
|
includes(:count).group('ar_ratings.id').order("ar_ratings.#{column.downcase} #{direction.upcase}")
|
22
28
|
}
|
23
29
|
|
24
30
|
after_create do
|
25
|
-
|
26
|
-
|
31
|
+
rating = ActsRateable::Rating.where({resource_id: self.id, resource_type: self.class.name}).first_or_initialize.save
|
32
|
+
ActsRateable::Count.where({resource_id: self.id, resource_type: self.class.name}).first_or_initialize.save #if !rates.empty?
|
27
33
|
end
|
28
34
|
|
29
35
|
include LocalInstanceMethods
|
30
|
-
|
31
36
|
end
|
32
37
|
end
|
33
38
|
|
data/lib/acts_rateable/count.rb
CHANGED
@@ -2,35 +2,30 @@ module ActsRateable
|
|
2
2
|
class Count < ActsRateable::ArRating
|
3
3
|
|
4
4
|
belongs_to :resource, polymorphic: true
|
5
|
-
# has_many :rates, through: :counts, as: :author
|
6
|
-
|
7
|
-
attr_accessible :resource_id, :resource_type, :total, :sum, :average, :estimate, :type
|
8
5
|
|
9
6
|
validates :resource, :total, :sum, :average, :estimate, presence: true
|
10
7
|
validates_numericality_of :total, :sum, :average, :estimate
|
11
8
|
|
12
|
-
|
9
|
+
unless (Rails::VERSION::STRING.to_f >= 4)
|
10
|
+
attr_accessible :resource_id, :resource_type, :total, :sum, :average, :estimate, :type
|
11
|
+
end
|
13
12
|
|
14
13
|
before_save :update_ratings
|
15
14
|
|
16
|
-
def self.set_totals(author)
|
17
|
-
sql = "SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, "+
|
18
|
-
"(SELECT COUNT(DISTINCT author_id) FROM ar_rates WHERE author_type = '#{author.class.base_class.name}') rated_count, "+
|
19
|
-
"((SELECT COUNT(*) from ar_rates WHERE author_type = '#{author.class.base_class.name}') / (SELECT COUNT(DISTINCT author_id) FROM ar_rates WHERE author_type = '#{author.class.base_class.name}')) avg_num_ratings "+
|
20
|
-
"FROM ar_rates WHERE author_type = '#{author.class.base_class.name}'"
|
21
|
-
@@global_counts[author.class.base_class.name] = ActsRateable::Rate.connection.execute(sql).first
|
22
|
-
end
|
23
|
-
|
24
|
-
# RETURNS = { "total_ratings"=>"", "rating_sum"=>"", "rating_avg"=>"", "rated_count"=>"", "avg_num_ratings"=>"" }
|
25
15
|
def self.get_totals(author)
|
26
|
-
|
16
|
+
sql = "SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, "+
|
17
|
+
"(SELECT COUNT(DISTINCT author_id) FROM ar_rates WHERE author_type = '#{author.class.name}') rated_count, "+
|
18
|
+
"((SELECT COUNT(*) from ar_rates WHERE author_type = '#{author.class.name}') / (SELECT COUNT(DISTINCT author_id) FROM ar_rates WHERE author_type = '#{author.class.name}')) avg_num_ratings "+
|
19
|
+
"FROM ar_rates WHERE author_type = '#{author.class.name}'"
|
20
|
+
# RETURNS = { "total_ratings"=>"", "rating_sum"=>"", "rating_avg"=>"", "rated_count"=>"", "avg_num_ratings"=>"" }
|
21
|
+
ActsRateable::Rate.connection.execute(sql).first
|
27
22
|
end
|
28
23
|
|
29
|
-
# RETURNS = {"total_ratings"=>"", "rating_sum"=>"", "rating_avg"=>""}
|
30
24
|
def self.values_for(author)
|
31
25
|
sql = "SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg "+
|
32
|
-
"FROM ar_rates WHERE author_type = '#{author.class.
|
33
|
-
|
26
|
+
"FROM ar_rates WHERE author_type = '#{author.class.name}' and author_id = '#{author.id}'"
|
27
|
+
# RETURNS = {"total_ratings"=>"", "rating_sum"=>"", "rating_avg"=>""}
|
28
|
+
ActsRateable::Rate.connection.execute(sql).first
|
34
29
|
end
|
35
30
|
|
36
31
|
def self.data_for(author)
|
@@ -49,7 +44,6 @@ module ActsRateable
|
|
49
44
|
self.average = result['local']['rating_avg']
|
50
45
|
self.sum = result['local']['rating_sum']
|
51
46
|
self.estimate = result['local']['estimate']
|
52
|
-
self.class.set_totals(resource) # Reset global values
|
53
47
|
end
|
54
48
|
end
|
55
49
|
end
|
data/lib/acts_rateable/rate.rb
CHANGED
@@ -10,15 +10,17 @@ module ActsRateable
|
|
10
10
|
|
11
11
|
validates_numericality_of :value, :greater_than_or_equal_to => 1, :less_than_or_equal_to => 100
|
12
12
|
validates_uniqueness_of :author_id, :scope => [:author_type, :resource_id, :resource_type]
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
|
14
|
+
unless (Rails::VERSION::STRING.to_f >= 4)
|
15
|
+
attr_accessible :resource_id, :resource_type, :author_type, :author_id, :value
|
16
|
+
end
|
17
|
+
|
16
18
|
after_save :generate_estimate
|
17
19
|
|
18
20
|
def self.rated?(resource, author)
|
19
21
|
rate = where({
|
20
|
-
author_type: author.class.
|
21
|
-
resource_type: resource.class.
|
22
|
+
author_type: author.class.name, author_id: author.id,
|
23
|
+
resource_type: resource.class.name, resource_id: resource.id
|
22
24
|
})
|
23
25
|
return rate if rate
|
24
26
|
return false
|
@@ -27,8 +29,8 @@ module ActsRateable
|
|
27
29
|
def self.create(author, resource, value)
|
28
30
|
return unless author && resource && value
|
29
31
|
atts = {
|
30
|
-
resource_type: resource.class.
|
31
|
-
author_type: author.class.
|
32
|
+
resource_type: resource.class.name, resource_id: resource.id,
|
33
|
+
author_type: author.class.name, author_id: author.id,
|
32
34
|
value: value
|
33
35
|
}
|
34
36
|
rate = where(atts.except(:value)).first_or_initialize(atts)
|
data/lib/acts_rateable/rating.rb
CHANGED
@@ -2,35 +2,30 @@ module ActsRateable
|
|
2
2
|
class Rating < ActsRateable::ArRating
|
3
3
|
|
4
4
|
belongs_to :resource, polymorphic: true
|
5
|
-
|
6
|
-
|
7
|
-
attr_accessible :resource_id, :resource_type, :total, :sum, :average, :estimate, :type
|
8
|
-
|
5
|
+
|
9
6
|
validates :resource, :total, :sum, :average, :estimate, presence: true
|
10
7
|
validates_numericality_of :total, :sum, :average, :estimate
|
11
8
|
|
12
|
-
|
9
|
+
unless (Rails::VERSION::STRING.to_f >= 4)
|
10
|
+
attr_accessible :resource_id, :resource_type, :total, :sum, :average, :estimate, :type
|
11
|
+
end
|
13
12
|
|
14
13
|
before_save :update_ratings
|
15
14
|
|
16
|
-
def self.set_totals(resource)
|
17
|
-
sql = "SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, "+
|
18
|
-
"(SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = '#{resource.class.base_class.name}') rated_count, "+
|
19
|
-
"((SELECT COUNT(*) from ar_rates WHERE resource_type = '#{resource.class.base_class.name}') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = '#{resource.class.base_class.name}')) avg_num_ratings "+
|
20
|
-
"FROM ar_rates WHERE resource_type = '#{resource.class.base_class.name}'"
|
21
|
-
@@global_ratings[resource.class.base_class.name] = ActsRateable::Rate.connection.execute(sql).first
|
22
|
-
end
|
23
|
-
|
24
15
|
# RETURNS = { "total_ratings"=>"", "rating_sum"=>"", "rating_avg"=>"", "rated_count"=>"", "avg_num_ratings"=>"" }
|
25
16
|
def self.get_totals(resource)
|
26
|
-
|
17
|
+
sql = "SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, "+
|
18
|
+
"(SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = '#{resource.class.name}') rated_count, "+
|
19
|
+
"((SELECT COUNT(*) from ar_rates WHERE resource_type = '#{resource.class.name}') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = '#{resource.class.name}')) avg_num_ratings "+
|
20
|
+
"FROM ar_rates WHERE resource_type = '#{resource.class.name}'"
|
21
|
+
ActsRateable::Rate.connection.execute(sql).first
|
27
22
|
end
|
28
23
|
|
29
24
|
# RETURNS = {"total_ratings"=>"", "rating_sum"=>"", "rating_avg"=>""}
|
30
25
|
def self.values_for(resource)
|
31
26
|
sql = "SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg "+
|
32
|
-
"FROM ar_rates WHERE resource_type = '#{resource.class.
|
33
|
-
|
27
|
+
"FROM ar_rates WHERE resource_type = '#{resource.class.name}' and resource_id = '#{resource.id}'"
|
28
|
+
ActsRateable::Rate.connection.execute(sql).first
|
34
29
|
end
|
35
30
|
|
36
31
|
def self.data_for(resource)
|
@@ -49,7 +44,6 @@ module ActsRateable
|
|
49
44
|
self.average = result['local']['rating_avg']
|
50
45
|
self.sum = result['local']['rating_sum']
|
51
46
|
self.estimate = result['local']['estimate']
|
52
|
-
self.class.set_totals(resource) # Reset global values
|
53
47
|
end
|
54
48
|
end
|
55
49
|
end
|
metadata
CHANGED
@@ -1,48 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_rateable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.8
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Ty Rauber
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: rails
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '3.1'
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '3.1'
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: sqlite3
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
38
|
-
type: :development
|
39
|
-
prerelease: false
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ! '>='
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
11
|
+
date: 2014-04-27 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
46
13
|
description: Rails 3 Bayesian Ratings Gem
|
47
14
|
email:
|
48
15
|
- tyrauber@mac.com
|
@@ -50,211 +17,43 @@ executables: []
|
|
50
17
|
extensions: []
|
51
18
|
extra_rdoc_files: []
|
52
19
|
files:
|
20
|
+
- MIT-LICENSE
|
21
|
+
- README.rdoc
|
22
|
+
- Rakefile
|
23
|
+
- lib/acts_rateable.rb
|
53
24
|
- lib/acts_rateable/acts_rateable.rb
|
54
25
|
- lib/acts_rateable/ar_rating.rb
|
55
26
|
- lib/acts_rateable/count.rb
|
56
27
|
- lib/acts_rateable/rate.rb
|
57
28
|
- lib/acts_rateable/rating.rb
|
58
29
|
- lib/acts_rateable/version.rb
|
59
|
-
- lib/acts_rateable.rb
|
60
30
|
- lib/generators/acts_rateable/acts_rateable_generator.rb
|
61
31
|
- lib/generators/acts_rateable/templates/migration.rb
|
62
|
-
- MIT-LICENSE
|
63
|
-
- Rakefile
|
64
|
-
- README.rdoc
|
65
|
-
- test/acts_rateable_test.rb
|
66
|
-
- test/dummy/app/assets/javascripts/application.js
|
67
|
-
- test/dummy/app/assets/stylesheets/application.css
|
68
|
-
- test/dummy/app/controllers/application_controller.rb
|
69
|
-
- test/dummy/app/helpers/application_helper.rb
|
70
|
-
- test/dummy/app/models/post.rb
|
71
|
-
- test/dummy/app/models/user.rb
|
72
|
-
- test/dummy/app/views/layouts/application.html.erb
|
73
|
-
- test/dummy/config/application.rb
|
74
|
-
- test/dummy/config/boot.rb
|
75
|
-
- test/dummy/config/database.yml
|
76
|
-
- test/dummy/config/environment.rb
|
77
|
-
- test/dummy/config/environments/development.rb
|
78
|
-
- test/dummy/config/environments/production.rb
|
79
|
-
- test/dummy/config/environments/test.rb
|
80
|
-
- test/dummy/config/initializers/backtrace_silencers.rb
|
81
|
-
- test/dummy/config/initializers/inflections.rb
|
82
|
-
- test/dummy/config/initializers/mime_types.rb
|
83
|
-
- test/dummy/config/initializers/secret_token.rb
|
84
|
-
- test/dummy/config/initializers/session_store.rb
|
85
|
-
- test/dummy/config/initializers/wrap_parameters.rb
|
86
|
-
- test/dummy/config/locales/en.yml
|
87
|
-
- test/dummy/config/routes.rb
|
88
|
-
- test/dummy/config.ru
|
89
|
-
- test/dummy/coverage/assets/0.7.1/application.css
|
90
|
-
- test/dummy/coverage/assets/0.7.1/application.js
|
91
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/blank.gif
|
92
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_close.png
|
93
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_loading.png
|
94
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_nav_left.png
|
95
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_nav_right.png
|
96
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_e.png
|
97
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_n.png
|
98
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_ne.png
|
99
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_nw.png
|
100
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_s.png
|
101
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_se.png
|
102
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_sw.png
|
103
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_w.png
|
104
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_title_left.png
|
105
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_title_main.png
|
106
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_title_over.png
|
107
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_title_right.png
|
108
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancybox-x.png
|
109
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancybox-y.png
|
110
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancybox.png
|
111
|
-
- test/dummy/coverage/assets/0.7.1/favicon_green.png
|
112
|
-
- test/dummy/coverage/assets/0.7.1/favicon_red.png
|
113
|
-
- test/dummy/coverage/assets/0.7.1/favicon_yellow.png
|
114
|
-
- test/dummy/coverage/assets/0.7.1/loading.gif
|
115
|
-
- test/dummy/coverage/assets/0.7.1/magnify.png
|
116
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
|
117
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
|
118
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
|
119
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
|
120
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_dadada_1x400.png
|
121
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
|
122
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
|
123
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
|
124
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-icons_222222_256x240.png
|
125
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-icons_2e83ff_256x240.png
|
126
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-icons_454545_256x240.png
|
127
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-icons_888888_256x240.png
|
128
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-icons_cd0a0a_256x240.png
|
129
|
-
- test/dummy/coverage/index.html
|
130
|
-
- test/dummy/db/development.sqlite3
|
131
|
-
- test/dummy/db/migrate/20130520024319_create_posts.rb
|
132
|
-
- test/dummy/db/migrate/20130520024332_create_users.rb
|
133
|
-
- test/dummy/db/migrate/20130520163820_acts_rateable_migration.rb
|
134
|
-
- test/dummy/db/schema.rb
|
135
|
-
- test/dummy/db/test.sqlite3
|
136
|
-
- test/dummy/log/development.log
|
137
|
-
- test/dummy/log/test.log
|
138
|
-
- test/dummy/public/404.html
|
139
|
-
- test/dummy/public/422.html
|
140
|
-
- test/dummy/public/500.html
|
141
|
-
- test/dummy/public/favicon.ico
|
142
|
-
- test/dummy/Rakefile
|
143
|
-
- test/dummy/README.rdoc
|
144
|
-
- test/dummy/script/rails
|
145
|
-
- test/dummy/spec/factories/post.rb
|
146
|
-
- test/dummy/spec/factories/user.rb
|
147
|
-
- test/dummy/spec/models/acts_rateable_spec.rb
|
148
|
-
- test/dummy/spec/spec_helper.rb
|
149
32
|
homepage: https://github.com/tyrauber/acts_rateable
|
150
|
-
licenses:
|
33
|
+
licenses:
|
34
|
+
- MIT
|
35
|
+
metadata: {}
|
151
36
|
post_install_message:
|
152
37
|
rdoc_options: []
|
153
38
|
require_paths:
|
154
39
|
- lib
|
155
40
|
required_ruby_version: !ruby/object:Gem::Requirement
|
156
|
-
none: false
|
157
41
|
requirements:
|
158
42
|
- - ! '>='
|
159
43
|
- !ruby/object:Gem::Version
|
160
44
|
version: '0'
|
161
45
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
162
|
-
none: false
|
163
46
|
requirements:
|
164
47
|
- - ! '>='
|
165
48
|
- !ruby/object:Gem::Version
|
166
49
|
version: '0'
|
167
50
|
requirements: []
|
168
51
|
rubyforge_project:
|
169
|
-
rubygems_version:
|
52
|
+
rubygems_version: 2.2.2
|
170
53
|
signing_key:
|
171
|
-
specification_version:
|
54
|
+
specification_version: 4
|
172
55
|
summary: ActsRateable is a Ruby on Rails gem which makes ActiveRecord models rateable
|
173
56
|
through a polymorphic association. Bayesian Estimates are generated and cached for
|
174
57
|
each association enabling models to be quickly ordered by bayesian estimate.
|
175
|
-
test_files:
|
176
|
-
- test/acts_rateable_test.rb
|
177
|
-
- test/dummy/app/assets/javascripts/application.js
|
178
|
-
- test/dummy/app/assets/stylesheets/application.css
|
179
|
-
- test/dummy/app/controllers/application_controller.rb
|
180
|
-
- test/dummy/app/helpers/application_helper.rb
|
181
|
-
- test/dummy/app/models/post.rb
|
182
|
-
- test/dummy/app/models/user.rb
|
183
|
-
- test/dummy/app/views/layouts/application.html.erb
|
184
|
-
- test/dummy/config/application.rb
|
185
|
-
- test/dummy/config/boot.rb
|
186
|
-
- test/dummy/config/database.yml
|
187
|
-
- test/dummy/config/environment.rb
|
188
|
-
- test/dummy/config/environments/development.rb
|
189
|
-
- test/dummy/config/environments/production.rb
|
190
|
-
- test/dummy/config/environments/test.rb
|
191
|
-
- test/dummy/config/initializers/backtrace_silencers.rb
|
192
|
-
- test/dummy/config/initializers/inflections.rb
|
193
|
-
- test/dummy/config/initializers/mime_types.rb
|
194
|
-
- test/dummy/config/initializers/secret_token.rb
|
195
|
-
- test/dummy/config/initializers/session_store.rb
|
196
|
-
- test/dummy/config/initializers/wrap_parameters.rb
|
197
|
-
- test/dummy/config/locales/en.yml
|
198
|
-
- test/dummy/config/routes.rb
|
199
|
-
- test/dummy/config.ru
|
200
|
-
- test/dummy/coverage/assets/0.7.1/application.css
|
201
|
-
- test/dummy/coverage/assets/0.7.1/application.js
|
202
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/blank.gif
|
203
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_close.png
|
204
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_loading.png
|
205
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_nav_left.png
|
206
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_nav_right.png
|
207
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_e.png
|
208
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_n.png
|
209
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_ne.png
|
210
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_nw.png
|
211
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_s.png
|
212
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_se.png
|
213
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_sw.png
|
214
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_shadow_w.png
|
215
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_title_left.png
|
216
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_title_main.png
|
217
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_title_over.png
|
218
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancy_title_right.png
|
219
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancybox-x.png
|
220
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancybox-y.png
|
221
|
-
- test/dummy/coverage/assets/0.7.1/fancybox/fancybox.png
|
222
|
-
- test/dummy/coverage/assets/0.7.1/favicon_green.png
|
223
|
-
- test/dummy/coverage/assets/0.7.1/favicon_red.png
|
224
|
-
- test/dummy/coverage/assets/0.7.1/favicon_yellow.png
|
225
|
-
- test/dummy/coverage/assets/0.7.1/loading.gif
|
226
|
-
- test/dummy/coverage/assets/0.7.1/magnify.png
|
227
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
|
228
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
|
229
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
|
230
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
|
231
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_dadada_1x400.png
|
232
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
|
233
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
|
234
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
|
235
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-icons_222222_256x240.png
|
236
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-icons_2e83ff_256x240.png
|
237
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-icons_454545_256x240.png
|
238
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-icons_888888_256x240.png
|
239
|
-
- test/dummy/coverage/assets/0.7.1/smoothness/images/ui-icons_cd0a0a_256x240.png
|
240
|
-
- test/dummy/coverage/index.html
|
241
|
-
- test/dummy/db/development.sqlite3
|
242
|
-
- test/dummy/db/migrate/20130520024319_create_posts.rb
|
243
|
-
- test/dummy/db/migrate/20130520024332_create_users.rb
|
244
|
-
- test/dummy/db/migrate/20130520163820_acts_rateable_migration.rb
|
245
|
-
- test/dummy/db/schema.rb
|
246
|
-
- test/dummy/db/test.sqlite3
|
247
|
-
- test/dummy/log/development.log
|
248
|
-
- test/dummy/log/test.log
|
249
|
-
- test/dummy/public/404.html
|
250
|
-
- test/dummy/public/422.html
|
251
|
-
- test/dummy/public/500.html
|
252
|
-
- test/dummy/public/favicon.ico
|
253
|
-
- test/dummy/Rakefile
|
254
|
-
- test/dummy/README.rdoc
|
255
|
-
- test/dummy/script/rails
|
256
|
-
- test/dummy/spec/factories/post.rb
|
257
|
-
- test/dummy/spec/factories/user.rb
|
258
|
-
- test/dummy/spec/models/acts_rateable_spec.rb
|
259
|
-
- test/dummy/spec/spec_helper.rb
|
58
|
+
test_files: []
|
260
59
|
has_rdoc:
|