acts_rateable 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,20 +10,14 @@ module ActsRateable
10
10
 
11
11
  has_many :rates, class_name: ActsRateable::Rate, as: :resource, dependent: :destroy
12
12
  has_many :rated, class_name: ActsRateable::Rate, as: :author, dependent: :destroy
13
- has_one :ratings, class_name: ActsRateable::Rating, as: :resource, dependent: :destroy
14
-
15
- # Resource.order_by(column, direction)
16
- # => column: total, average, sum, estimate
17
- # => direction: DESC, ASC
18
-
19
- scope :order_by, lambda { | column='estimate', direction="DESC" |
20
- joins("LEFT OUTER JOIN ar_ratings ON ar_ratings.resource_id = #{self.table_name}.id AND ar_ratings.resource_type = '#{self.name}'").
21
- select("#{self.table_name}.*, COALESCE(ar_ratings.total, 0) as total, COALESCE(ar_ratings.average, 0) as average, COALESCE(ar_ratings.sum, 0) as sum, COALESCE(ar_ratings.estimate, 0) as estimate").
22
- order("#{column.downcase} #{direction.upcase}")
13
+ has_one :rating, class_name: ActsRateable::Rating, as: :resource, dependent: :destroy
14
+
15
+ scope :order_by_rating, lambda { | column='estimate', direction="DESC" |
16
+ includes(:rating).group('ar_ratings.id').order("ar_ratings.#{column.downcase} #{direction.upcase}")
23
17
  }
24
18
 
25
19
  after_save do
26
- ActsRateable::Rating.create(self) if !rates.empty?
20
+ ActsRateable::Rating.where({resource_id: self.id, resource_type: self.class.name}).first_or_create #if !rates.empty?
27
21
  end
28
22
 
29
23
  include LocalInstanceMethods
@@ -33,14 +27,9 @@ module ActsRateable
33
27
 
34
28
  module LocalInstanceMethods
35
29
 
36
- # Returns the resource rating
37
- # column: total, sum, average and estimate
38
- def rating(column='estimate')
39
- ratings.nil? ? nil : ratings[column]
40
- end
41
30
 
42
31
  def variation( author )
43
- rated_by?(author) ? (rated_by?(author).value/self.rating) : nil
32
+ rated_by?(author) ? (rated_by?(author).value/self.rating['estimate']) : nil
44
33
  end
45
34
 
46
35
  # Checks wheter a resource has been rated by a user. Returns the rating if true, otherwise returns false.
@@ -40,7 +40,7 @@ module ActsRateable
40
40
  private
41
41
 
42
42
  def generate_estimate
43
- ActsRateable::Rating.create(resource)
43
+ ActsRateable::Rating.create({resource_id: resource.id, resource_type: resource.class.name})
44
44
  end
45
45
  end
46
46
  end
@@ -13,6 +13,8 @@ module ActsRateable
13
13
 
14
14
  @@global_ratings = {}
15
15
 
16
+ before_save :update_ratings
17
+
16
18
  def self.set_totals(resource)
17
19
  sql = "SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, "+
18
20
  "(SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = '#{resource.class.name}') rated_count, "+
@@ -40,15 +42,16 @@ module ActsRateable
40
42
  return { 'global' => global, 'local' => local.merge!({ 'estimate' => estimate }) }
41
43
  end
42
44
 
43
- def self.create(resource)
44
- record = where({ resource_type: resource.class.name, resource_id: resource.id }).first_or_initialize
45
- result = data_for(resource)
46
- record.total = result['local']['total_ratings']
47
- record.average = result['local']['rating_avg']
48
- record.sum = result['local']['rating_sum']
49
- record.estimate = result['local']['estimate']
50
- if record.save
51
- set_totals(resource) # Reset global values
45
+ protected
46
+
47
+ def update_ratings
48
+ if !resource.rates.empty?
49
+ result = self.class.data_for(resource)
50
+ self.total = result['local']['total_ratings']
51
+ self.average = result['local']['rating_avg']
52
+ self.sum = result['local']['rating_sum']
53
+ self.estimate = result['local']['estimate']
54
+ self.class.set_totals(resource) # Reset global values
52
55
  end
53
56
  end
54
57
  end
@@ -1,3 +1,3 @@
1
1
  module ActsRateable
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
Binary file
@@ -3637,716 +3637,3 @@ Connecting to database specified by database.yml
3637
3637
   (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3638
3638
   (0.8ms) commit transaction
3639
3639
   (0.1ms) SELECT COUNT(*) FROM "ar_rates" WHERE "ar_rates"."resource_id" = 105 AND "ar_rates"."resource_type" = 'Post'
3640
- Connecting to database specified by database.yml
3641
-  (0.1ms) begin transaction
3642
- SQL (10.0ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:09 UTC +00:00], ["name", "Reyna"], ["updated_at", Thu, 23 May 2013 20:08:09 UTC +00:00], ["value", nil]]
3643
-  (1.0ms) commit transaction
3644
-  (0.0ms) begin transaction
3645
- SQL (1.3ms) INSERT INTO "posts" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:09 UTC +00:00], ["name", "culpa ut laboriosam eaque itaque"], ["updated_at", Thu, 23 May 2013 20:08:09 UTC +00:00], ["value", nil]]
3646
-  (0.9ms) commit transaction
3647
- ActsRateable::Rate Load (0.6ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 106 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 202 LIMIT 1
3648
-  (0.1ms) begin transaction
3649
- User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 202 LIMIT 1
3650
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 106 LIMIT 1
3651
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 202 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 106 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3652
- SQL (1.7ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 202], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:09 UTC +00:00], ["resource_id", 106], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:09 UTC +00:00], ["value", 1]]
3653
- ActsRateable::Rating Load (0.5ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 106 LIMIT 1
3654
-  (0.2ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '106'
3655
-  (1.6ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3656
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 106 LIMIT 1
3657
- SQL (1.2ms) INSERT INTO "ar_ratings" ("average", "created_at", "estimate", "resource_id", "resource_type", "sum", "total", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["average", #<BigDecimal:7fb2b4579748,'0.1E1',9(45)>], ["created_at", Thu, 23 May 2013 20:08:09 UTC +00:00], ["estimate", #<BigDecimal:7fb2b4579518,'0.2440548780 487805E1',27(45)>], ["resource_id", 106], ["resource_type", "Post"], ["sum", 1], ["total", 1], ["updated_at", Thu, 23 May 2013 20:08:09 UTC +00:00]]
3658
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3659
-  (1.1ms) commit transaction
3660
-  (0.2ms) SELECT COUNT(*) FROM "ar_rates" WHERE "ar_rates"."author_id" = 202 AND "ar_rates"."author_type" = 'User'
3661
-  (0.1ms) begin transaction
3662
- SQL (0.4ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:09 UTC +00:00], ["name", "Lelia"], ["updated_at", Thu, 23 May 2013 20:08:09 UTC +00:00], ["value", nil]]
3663
-  (0.9ms) commit transaction
3664
-  (0.0ms) begin transaction
3665
- SQL (0.3ms) INSERT INTO "posts" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:09 UTC +00:00], ["name", "consectetur nam modi possimus ipsa"], ["updated_at", Thu, 23 May 2013 20:08:09 UTC +00:00], ["value", nil]]
3666
-  (0.8ms) commit transaction
3667
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 107 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 203 LIMIT 1
3668
-  (0.0ms) begin transaction
3669
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 203 LIMIT 1
3670
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 107 LIMIT 1
3671
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 203 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 107 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3672
- SQL (0.3ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 203], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:09 UTC +00:00], ["resource_id", 107], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:09 UTC +00:00], ["value", 5]]
3673
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 107 LIMIT 1
3674
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '107'
3675
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 107 LIMIT 1
3676
- SQL (0.2ms) INSERT INTO "ar_ratings" ("average", "created_at", "estimate", "resource_id", "resource_type", "sum", "total", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["average", #<BigDecimal:7fb2b196c5b0,'0.5E1',9(45)>], ["created_at", Thu, 23 May 2013 20:08:09 UTC +00:00], ["estimate", #<BigDecimal:7fb2b196c330,'0.3440548780 487805E1',27(45)>], ["resource_id", 107], ["resource_type", "Post"], ["sum", 5], ["total", 1], ["updated_at", Thu, 23 May 2013 20:08:09 UTC +00:00]]
3677
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3678
-  (0.6ms) commit transaction
3679
- ActsRateable::Rating Load (0.2ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_id" = 107 AND "ar_ratings"."resource_type" = 'Post' LIMIT 1
3680
-  (0.0ms) begin transaction
3681
- SQL (0.4ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Esta"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3682
-  (0.9ms) commit transaction
3683
-  (0.0ms) begin transaction
3684
- SQL (0.3ms) INSERT INTO "posts" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "repellendus ut sed qui qui"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3685
-  (0.9ms) commit transaction
3686
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 108 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 204 LIMIT 1
3687
-  (0.0ms) begin transaction
3688
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 204 LIMIT 1
3689
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 108 LIMIT 1
3690
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 204 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 108 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3691
- SQL (0.4ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 204], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 108], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 4]]
3692
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 108 LIMIT 1
3693
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '108'
3694
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 108 LIMIT 1
3695
- SQL (0.2ms) INSERT INTO "ar_ratings" ("average", "created_at", "estimate", "resource_id", "resource_type", "sum", "total", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["average", #<BigDecimal:7fb2b4740090,'0.4E1',9(45)>], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["estimate", #<BigDecimal:7fb2b473fcd0,'0.32E1',18(45)>], ["resource_id", 108], ["resource_type", "Post"], ["sum", 4], ["total", 1], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00]]
3696
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3697
-  (0.9ms) commit transaction
3698
-  (0.1ms) SELECT COUNT(*) FROM "ar_rates" WHERE "ar_rates"."resource_id" = 108 AND "ar_rates"."resource_type" = 'Post'
3699
-  (0.0ms) begin transaction
3700
- SQL (0.4ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Jerrod"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3701
-  (0.8ms) commit transaction
3702
-  (0.0ms) begin transaction
3703
- SQL (0.3ms) INSERT INTO "posts" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "optio praesentium quas id accusamus"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3704
-  (0.8ms) commit transaction
3705
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 205 LIMIT 1
3706
-  (0.0ms) begin transaction
3707
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 205 LIMIT 1
3708
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3709
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 205 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3710
- SQL (0.3ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 205], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 109], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 3]]
3711
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 109 LIMIT 1
3712
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '109'
3713
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3714
- SQL (0.2ms) INSERT INTO "ar_ratings" ("average", "created_at", "estimate", "resource_id", "resource_type", "sum", "total", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["average", #<BigDecimal:7fb2b727c380,'0.3E1',9(45)>], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["estimate", #<BigDecimal:7fb2b727c1c8,'0.2954819277 108434E1',27(45)>], ["resource_id", 109], ["resource_type", "Post"], ["sum", 3], ["total", 1], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00]]
3715
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3716
-  (0.9ms) commit transaction
3717
-  (0.0ms) begin transaction
3718
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Graciela"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3719
-  (0.9ms) commit transaction
3720
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 206 LIMIT 1
3721
-  (0.0ms) begin transaction
3722
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 206 LIMIT 1
3723
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3724
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 206 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3725
- SQL (0.3ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 206], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 109], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 3]]
3726
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 109 LIMIT 1
3727
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '109'
3728
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3729
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 2, "sum" = 6, "estimate" = 2.964071856287426, "updated_at" = '2013-05-23 20:08:10.046271' WHERE "ar_ratings"."id" = 83
3730
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3731
-  (1.0ms) commit transaction
3732
-  (0.0ms) begin transaction
3733
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Yolanda"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3734
-  (0.9ms) commit transaction
3735
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 207 LIMIT 1
3736
-  (0.0ms) begin transaction
3737
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 207 LIMIT 1
3738
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3739
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 207 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3740
- SQL (0.4ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 207], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 109], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 2]]
3741
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 109 LIMIT 1
3742
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '109'
3743
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3744
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 3, "average" = 2.666666666666667, "sum" = 8, "estimate" = 2.803571428571429, "updated_at" = '2013-05-23 20:08:10.059742' WHERE "ar_ratings"."id" = 83
3745
-  (0.5ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3746
-  (1.0ms) commit transaction
3747
-  (0.0ms) begin transaction
3748
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Zane"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3749
-  (0.8ms) commit transaction
3750
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 208 LIMIT 1
3751
-  (0.0ms) begin transaction
3752
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 208 LIMIT 1
3753
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3754
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 208 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3755
- SQL (0.4ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 208], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 109], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 1]]
3756
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 109 LIMIT 1
3757
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '109'
3758
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3759
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 4, "average" = 2.25, "sum" = 9, "estimate" = 2.543533389687235, "updated_at" = '2013-05-23 20:08:10.071685' WHERE "ar_ratings"."id" = 83
3760
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3761
-  (1.0ms) commit transaction
3762
-  (0.0ms) begin transaction
3763
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Alvena"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3764
-  (0.8ms) commit transaction
3765
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 209 LIMIT 1
3766
-  (0.0ms) begin transaction
3767
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 209 LIMIT 1
3768
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3769
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 209 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3770
- SQL (0.3ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 209], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 109], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 5]]
3771
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 109 LIMIT 1
3772
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '109'
3773
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3774
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 5, "average" = 2.8, "sum" = 14, "estimate" = 2.846323529411765, "updated_at" = '2013-05-23 20:08:10.083564' WHERE "ar_ratings"."id" = 83
3775
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3776
-  (0.8ms) commit transaction
3777
-  (0.0ms) begin transaction
3778
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Hailie"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3779
-  (0.9ms) commit transaction
3780
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 210 LIMIT 1
3781
-  (0.0ms) begin transaction
3782
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 210 LIMIT 1
3783
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3784
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 210 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3785
- SQL (0.3ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 210], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 109], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 4]]
3786
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 109 LIMIT 1
3787
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '109'
3788
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3789
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 6, "average" = 3.0, "sum" = 18, "estimate" = 2.978557504873294, "updated_at" = '2013-05-23 20:08:10.095177' WHERE "ar_ratings"."id" = 83
3790
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3791
-  (0.9ms) commit transaction
3792
-  (0.0ms) begin transaction
3793
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Walker"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3794
-  (0.9ms) commit transaction
3795
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 211 LIMIT 1
3796
-  (0.0ms) begin transaction
3797
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 211 LIMIT 1
3798
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3799
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 211 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3800
- SQL (0.4ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 211], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 109], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 3]]
3801
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 109 LIMIT 1
3802
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '109'
3803
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3804
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 7, "sum" = 21, "estimate" = 2.982558139534883, "updated_at" = '2013-05-23 20:08:10.106856' WHERE "ar_ratings"."id" = 83
3805
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3806
-  (0.9ms) commit transaction
3807
-  (0.0ms) begin transaction
3808
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Gustave"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3809
-  (0.9ms) commit transaction
3810
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 212 LIMIT 1
3811
-  (0.0ms) begin transaction
3812
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 212 LIMIT 1
3813
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3814
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 212 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3815
- SQL (0.4ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 212], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 109], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 3]]
3816
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 109 LIMIT 1
3817
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '109'
3818
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3819
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 8, "sum" = 24, "estimate" = 2.984235417761429, "updated_at" = '2013-05-23 20:08:10.118344' WHERE "ar_ratings"."id" = 83
3820
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3821
-  (1.0ms) commit transaction
3822
-  (0.0ms) begin transaction
3823
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Adolph"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3824
-  (0.7ms) commit transaction
3825
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 213 LIMIT 1
3826
-  (0.0ms) begin transaction
3827
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 213 LIMIT 1
3828
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3829
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 213 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3830
- SQL (0.4ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 213], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 109], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 1]]
3831
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 109 LIMIT 1
3832
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '109'
3833
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3834
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 9, "average" = 2.777777777777778, "sum" = 25, "estimate" = 2.818965517241379, "updated_at" = '2013-05-23 20:08:10.129893' WHERE "ar_ratings"."id" = 83
3835
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3836
-  (0.9ms) commit transaction
3837
-  (0.0ms) begin transaction
3838
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Kian"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3839
-  (0.9ms) commit transaction
3840
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 214 LIMIT 1
3841
-  (0.0ms) begin transaction
3842
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 214 LIMIT 1
3843
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3844
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 214 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3845
- SQL (0.4ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 214], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 109], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 1]]
3846
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 109 LIMIT 1
3847
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '109'
3848
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3849
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 10, "average" = 2.6, "sum" = 26, "estimate" = 2.676483516483517, "updated_at" = '2013-05-23 20:08:10.141559' WHERE "ar_ratings"."id" = 83
3850
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3851
-  (0.8ms) commit transaction
3852
-  (0.0ms) begin transaction
3853
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Jamal"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3854
-  (0.9ms) commit transaction
3855
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 215 LIMIT 1
3856
-  (0.0ms) begin transaction
3857
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 215 LIMIT 1
3858
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3859
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 215 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3860
- SQL (0.3ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 215], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 109], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 5]]
3861
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 109 LIMIT 1
3862
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '109'
3863
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3864
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 11, "average" = 2.818181818181818, "sum" = 31, "estimate" = 2.840097402597403, "updated_at" = '2013-05-23 20:08:10.153205' WHERE "ar_ratings"."id" = 83
3865
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3866
-  (1.0ms) commit transaction
3867
-  (0.0ms) begin transaction
3868
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Aurore"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3869
-  (0.9ms) commit transaction
3870
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 216 LIMIT 1
3871
-  (0.0ms) begin transaction
3872
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 216 LIMIT 1
3873
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3874
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 216 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3875
- SQL (0.3ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 216], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 109], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 5]]
3876
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 109 LIMIT 1
3877
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '109'
3878
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3879
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 12, "average" = 3.0, "sum" = 36, "estimate" = 2.986440677966102, "updated_at" = '2013-05-23 20:08:10.164959' WHERE "ar_ratings"."id" = 83
3880
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3881
-  (0.7ms) commit transaction
3882
-  (0.0ms) begin transaction
3883
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Marty"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3884
-  (0.9ms) commit transaction
3885
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 217 LIMIT 1
3886
-  (0.0ms) begin transaction
3887
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 217 LIMIT 1
3888
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3889
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 217 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3890
- SQL (0.4ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 217], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 109], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 4]]
3891
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 109 LIMIT 1
3892
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '109'
3893
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3894
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 13, "average" = 3.076923076923077, "sum" = 40, "estimate" = 3.051966292134832, "updated_at" = '2013-05-23 20:08:10.176351' WHERE "ar_ratings"."id" = 83
3895
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3896
-  (1.0ms) commit transaction
3897
-  (0.0ms) begin transaction
3898
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Dortha"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3899
-  (0.8ms) commit transaction
3900
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 218 LIMIT 1
3901
-  (0.0ms) begin transaction
3902
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 218 LIMIT 1
3903
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3904
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 218 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3905
- SQL (0.3ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 218], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 109], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 1]]
3906
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 109 LIMIT 1
3907
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '109'
3908
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3909
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 14, "average" = 2.928571428571428, "sum" = 41, "estimate" = 2.932303647716069, "updated_at" = '2013-05-23 20:08:10.187970' WHERE "ar_ratings"."id" = 83
3910
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3911
-  (1.0ms) commit transaction
3912
-  (0.0ms) begin transaction
3913
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Levi"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3914
-  (0.9ms) commit transaction
3915
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 219 LIMIT 1
3916
-  (0.0ms) begin transaction
3917
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 219 LIMIT 1
3918
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3919
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 219 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3920
- SQL (0.3ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 219], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 109], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 1]]
3921
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 109 LIMIT 1
3922
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '109'
3923
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3924
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 15, "average" = 2.8, "sum" = 42, "estimate" = 2.823148148148148, "updated_at" = '2013-05-23 20:08:10.199555' WHERE "ar_ratings"."id" = 83
3925
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3926
-  (0.9ms) commit transaction
3927
-  (0.0ms) begin transaction
3928
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Anissa"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3929
-  (0.7ms) commit transaction
3930
- ActsRateable::Rate Load (0.2ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 220 LIMIT 1
3931
-  (0.0ms) begin transaction
3932
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 220 LIMIT 1
3933
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3934
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 220 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3935
- SQL (0.4ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 220], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 109], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 5]]
3936
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 109 LIMIT 1
3937
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '109'
3938
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3939
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 16, "average" = 2.9375, "sum" = 47, "estimate" = 2.936027915091596, "updated_at" = '2013-05-23 20:08:10.249967' WHERE "ar_ratings"."id" = 83
3940
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3941
-  (1.1ms) commit transaction
3942
-  (0.0ms) begin transaction
3943
- SQL (0.4ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Nikko"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3944
-  (0.9ms) commit transaction
3945
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 221 LIMIT 1
3946
-  (0.0ms) begin transaction
3947
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 221 LIMIT 1
3948
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3949
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 221 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 109 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3950
- SQL (0.3ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 221], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 109], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 5]]
3951
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 109 LIMIT 1
3952
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '109'
3953
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 109 LIMIT 1
3954
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 17, "average" = 3.058823529411764, "sum" = 52, "estimate" = 3.040934065934066, "updated_at" = '2013-05-23 20:08:10.262890' WHERE "ar_ratings"."id" = 83
3955
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3956
-  (0.8ms) commit transaction
3957
-  (1.2ms) SELECT COUNT(DISTINCT "posts"."id") FROM "posts" LEFT OUTER JOIN "ar_ratings" ON "ar_ratings"."resource_id" = "posts"."id" AND "ar_ratings"."resource_type" = 'Post'
3958
-  (0.1ms) begin transaction
3959
- SQL (0.4ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Jeremie"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3960
-  (0.6ms) commit transaction
3961
-  (0.0ms) begin transaction
3962
- SQL (0.3ms) INSERT INTO "posts" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "veniam fugit sequi excepturi porro"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3963
-  (0.6ms) commit transaction
3964
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 222 LIMIT 1
3965
-  (0.0ms) begin transaction
3966
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 222 LIMIT 1
3967
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
3968
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 222 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3969
- SQL (0.4ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 222], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 110], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 3]]
3970
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 110 LIMIT 1
3971
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '110'
3972
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
3973
- SQL (0.2ms) INSERT INTO "ar_ratings" ("average", "created_at", "estimate", "resource_id", "resource_type", "sum", "total", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["average", #<BigDecimal:7fb2b45cccb8,'0.3E1',9(45)>], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["estimate", #<BigDecimal:7fb2b45cc7b8,'0.2963114754 098361E1',27(45)>], ["resource_id", 110], ["resource_type", "Post"], ["sum", 3], ["total", 1], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00]]
3974
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3975
-  (1.0ms) commit transaction
3976
-  (0.0ms) begin transaction
3977
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Adell"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3978
-  (0.6ms) commit transaction
3979
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 223 LIMIT 1
3980
-  (0.0ms) begin transaction
3981
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 223 LIMIT 1
3982
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
3983
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 223 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3984
- SQL (0.3ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 223], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 110], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 5]]
3985
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 110 LIMIT 1
3986
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '110'
3987
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
3988
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 2, "average" = 4.0, "sum" = 8, "estimate" = 3.370652173913044, "updated_at" = '2013-05-23 20:08:10.298359' WHERE "ar_ratings"."id" = 84
3989
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
3990
-  (0.9ms) commit transaction
3991
-  (0.0ms) begin transaction
3992
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Korey"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
3993
-  (0.8ms) commit transaction
3994
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 224 LIMIT 1
3995
-  (0.0ms) begin transaction
3996
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 224 LIMIT 1
3997
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
3998
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 224 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
3999
- SQL (0.4ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 224], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 110], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 4]]
4000
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 110 LIMIT 1
4001
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '110'
4002
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4003
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 3, "sum" = 12, "estimate" = 3.481081081081081, "updated_at" = '2013-05-23 20:08:10.310259' WHERE "ar_ratings"."id" = 84
4004
-  (0.5ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
4005
-  (0.9ms) commit transaction
4006
-  (0.0ms) begin transaction
4007
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Olen"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4008
-  (0.9ms) commit transaction
4009
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 225 LIMIT 1
4010
-  (0.0ms) begin transaction
4011
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 225 LIMIT 1
4012
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4013
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 225 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
4014
- SQL (0.3ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 225], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 110], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 2]]
4015
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 110 LIMIT 1
4016
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '110'
4017
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4018
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 4, "average" = 3.5, "sum" = 14, "estimate" = 3.271889400921659, "updated_at" = '2013-05-23 20:08:10.322195' WHERE "ar_ratings"."id" = 84
4019
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
4020
-  (0.7ms) commit transaction
4021
-  (0.0ms) begin transaction
4022
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Joanne"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4023
-  (1.0ms) commit transaction
4024
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 226 LIMIT 1
4025
-  (0.0ms) begin transaction
4026
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 226 LIMIT 1
4027
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4028
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 226 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
4029
- SQL (0.3ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 226], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 110], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 5]]
4030
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 110 LIMIT 1
4031
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '110'
4032
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4033
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 5, "average" = 3.8, "sum" = 19, "estimate" = 3.48596256684492, "updated_at" = '2013-05-23 20:08:10.333907' WHERE "ar_ratings"."id" = 84
4034
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
4035
-  (0.9ms) commit transaction
4036
-  (0.0ms) begin transaction
4037
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Jannie"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4038
-  (0.7ms) commit transaction
4039
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 227 LIMIT 1
4040
-  (0.0ms) begin transaction
4041
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 227 LIMIT 1
4042
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4043
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 227 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
4044
- SQL (0.4ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 227], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 110], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 3]]
4045
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 110 LIMIT 1
4046
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '110'
4047
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4048
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 6, "average" = 3.666666666666667, "sum" = 22, "estimate" = 3.435579196217494, "updated_at" = '2013-05-23 20:08:10.345481' WHERE "ar_ratings"."id" = 84
4049
-  (0.5ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
4050
-  (0.8ms) commit transaction
4051
-  (0.0ms) begin transaction
4052
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Vernon"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4053
-  (0.8ms) commit transaction
4054
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 228 LIMIT 1
4055
-  (0.0ms) begin transaction
4056
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 228 LIMIT 1
4057
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4058
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 228 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
4059
- SQL (0.3ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 228], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 110], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 4]]
4060
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 110 LIMIT 1
4061
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '110'
4062
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4063
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 7, "average" = 3.714285714285714, "sum" = 26, "estimate" = 3.492063492063492, "updated_at" = '2013-05-23 20:08:10.356906' WHERE "ar_ratings"."id" = 84
4064
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
4065
-  (0.8ms) commit transaction
4066
-  (0.4ms) begin transaction
4067
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Ignacio"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4068
-  (0.9ms) commit transaction
4069
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 229 LIMIT 1
4070
-  (0.0ms) begin transaction
4071
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 229 LIMIT 1
4072
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4073
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 229 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
4074
- SQL (0.4ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 229], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 110], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 5]]
4075
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 110 LIMIT 1
4076
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '110'
4077
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4078
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 8, "average" = 3.875, "sum" = 31, "estimate" = 3.630622009569378, "updated_at" = '2013-05-23 20:08:10.368656' WHERE "ar_ratings"."id" = 84
4079
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
4080
-  (0.7ms) commit transaction
4081
-  (0.0ms) begin transaction
4082
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Jesse"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4083
-  (0.7ms) commit transaction
4084
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 230 LIMIT 1
4085
-  (0.0ms) begin transaction
4086
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 230 LIMIT 1
4087
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4088
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 230 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
4089
- SQL (0.3ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 230], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 110], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 1]]
4090
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 110 LIMIT 1
4091
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '110'
4092
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4093
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 9, "average" = 3.555555555555555, "sum" = 32, "estimate" = 3.414048865619546, "updated_at" = '2013-05-23 20:08:10.380033' WHERE "ar_ratings"."id" = 84
4094
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
4095
-  (0.9ms) commit transaction
4096
-  (0.0ms) begin transaction
4097
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Myrl"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4098
-  (0.8ms) commit transaction
4099
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 231 LIMIT 1
4100
-  (0.0ms) begin transaction
4101
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 231 LIMIT 1
4102
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4103
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 231 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
4104
- SQL (0.3ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 231], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 110], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 2]]
4105
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 110 LIMIT 1
4106
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '110'
4107
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4108
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 10, "average" = 3.4, "sum" = 34, "estimate" = 3.302884615384615, "updated_at" = '2013-05-23 20:08:10.391536' WHERE "ar_ratings"."id" = 84
4109
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
4110
-  (0.9ms) commit transaction
4111
-  (0.0ms) begin transaction
4112
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Rupert"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4113
-  (0.8ms) commit transaction
4114
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 232 LIMIT 1
4115
-  (0.0ms) begin transaction
4116
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 232 LIMIT 1
4117
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4118
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 232 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
4119
- SQL (0.4ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 232], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 110], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 5]]
4120
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 110 LIMIT 1
4121
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '110'
4122
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4123
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 11, "average" = 3.545454545454545, "sum" = 39, "estimate" = 3.423019985196151, "updated_at" = '2013-05-23 20:08:10.402981' WHERE "ar_ratings"."id" = 84
4124
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
4125
-  (0.8ms) commit transaction
4126
-  (0.0ms) begin transaction
4127
- SQL (0.4ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Lambert"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4128
-  (0.9ms) commit transaction
4129
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 233 LIMIT 1
4130
-  (0.0ms) begin transaction
4131
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 233 LIMIT 1
4132
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4133
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 233 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
4134
- SQL (0.3ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 233], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 110], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 4]]
4135
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 110 LIMIT 1
4136
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '110'
4137
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4138
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 12, "average" = 3.583333333333333, "sum" = 43, "estimate" = 3.463573883161513, "updated_at" = '2013-05-23 20:08:10.414349' WHERE "ar_ratings"."id" = 84
4139
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
4140
-  (0.6ms) commit transaction
4141
-  (0.0ms) begin transaction
4142
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Moriah"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4143
-  (0.9ms) commit transaction
4144
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 234 LIMIT 1
4145
-  (0.0ms) begin transaction
4146
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 234 LIMIT 1
4147
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4148
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 234 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
4149
- SQL (0.4ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 234], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 110], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 4]]
4150
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 110 LIMIT 1
4151
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '110'
4152
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4153
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 13, "average" = 3.615384615384615, "sum" = 47, "estimate" = 3.498076923076923, "updated_at" = '2013-05-23 20:08:10.426058' WHERE "ar_ratings"."id" = 84
4154
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
4155
-  (0.6ms) commit transaction
4156
-  (0.0ms) begin transaction
4157
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Merl"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4158
-  (0.8ms) commit transaction
4159
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 235 LIMIT 1
4160
-  (0.0ms) begin transaction
4161
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 235 LIMIT 1
4162
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4163
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 235 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
4164
- SQL (0.3ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 235], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 110], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 5]]
4165
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 110 LIMIT 1
4166
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '110'
4167
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4168
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 14, "average" = 3.714285714285714, "sum" = 52, "estimate" = 3.587334933973589, "updated_at" = '2013-05-23 20:08:10.437198' WHERE "ar_ratings"."id" = 84
4169
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
4170
-  (0.9ms) commit transaction
4171
-  (0.0ms) begin transaction
4172
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Lina"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4173
-  (0.8ms) commit transaction
4174
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 236 LIMIT 1
4175
-  (0.0ms) begin transaction
4176
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 236 LIMIT 1
4177
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4178
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 236 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
4179
- SQL (0.4ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 236], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 110], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 5]]
4180
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 110 LIMIT 1
4181
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '110'
4182
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4183
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 15, "average" = 3.8, "sum" = 57, "estimate" = 3.66751269035533, "updated_at" = '2013-05-23 20:08:10.448694' WHERE "ar_ratings"."id" = 84
4184
-  (0.5ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
4185
-  (0.9ms) commit transaction
4186
-  (0.0ms) begin transaction
4187
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Michel"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4188
-  (0.8ms) commit transaction
4189
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 237 LIMIT 1
4190
-  (0.0ms) begin transaction
4191
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 237 LIMIT 1
4192
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4193
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 237 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
4194
- SQL (0.4ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 237], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 110], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 4]]
4195
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 110 LIMIT 1
4196
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '110'
4197
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4198
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 16, "average" = 3.8125, "sum" = 61, "estimate" = 3.686602870813397, "updated_at" = '2013-05-23 20:08:10.460342' WHERE "ar_ratings"."id" = 84
4199
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
4200
-  (0.9ms) commit transaction
4201
-  (0.0ms) begin transaction
4202
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Quinton"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4203
-  (0.8ms) commit transaction
4204
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 238 LIMIT 1
4205
-  (0.0ms) begin transaction
4206
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 238 LIMIT 1
4207
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4208
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 238 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
4209
- SQL (0.3ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 238], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 110], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 5]]
4210
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 110 LIMIT 1
4211
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '110'
4212
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4213
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 17, "average" = 3.882352941176471, "sum" = 66, "estimate" = 3.753015075376884, "updated_at" = '2013-05-23 20:08:10.471807' WHERE "ar_ratings"."id" = 84
4214
-  (0.5ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
4215
-  (0.7ms) commit transaction
4216
-  (0.0ms) begin transaction
4217
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Jana"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4218
-  (0.9ms) commit transaction
4219
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 239 LIMIT 1
4220
-  (0.0ms) begin transaction
4221
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 239 LIMIT 1
4222
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4223
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 239 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
4224
- SQL (0.4ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 239], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 110], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 2]]
4225
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 110 LIMIT 1
4226
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '110'
4227
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4228
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 18, "average" = 3.777777777777778, "sum" = 68, "estimate" = 3.670952380952381, "updated_at" = '2013-05-23 20:08:10.483499' WHERE "ar_ratings"."id" = 84
4229
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
4230
-  (0.8ms) commit transaction
4231
-  (0.0ms) begin transaction
4232
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Annamae"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4233
-  (0.7ms) commit transaction
4234
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 240 LIMIT 1
4235
-  (0.0ms) begin transaction
4236
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 240 LIMIT 1
4237
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4238
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 240 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
4239
- SQL (0.3ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 240], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 110], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 2]]
4240
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 110 LIMIT 1
4241
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '110'
4242
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4243
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 19, "average" = 3.684210526315789, "sum" = 70, "estimate" = 3.594301221166893, "updated_at" = '2013-05-23 20:08:10.494963' WHERE "ar_ratings"."id" = 84
4244
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
4245
-  (0.8ms) commit transaction
4246
-  (0.0ms) begin transaction
4247
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Waylon"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4248
-  (0.8ms) commit transaction
4249
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'Post' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."author_id" = 241 LIMIT 1
4250
-  (0.0ms) begin transaction
4251
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 241 LIMIT 1
4252
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4253
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 241 AND "ar_rates"."author_type" = 'User' AND "ar_rates"."resource_id" = 110 AND "ar_rates"."resource_type" = 'Post') LIMIT 1
4254
- SQL (0.3ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 241], ["author_type", "User"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 110], ["resource_type", "Post"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 4]]
4255
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'Post' AND "ar_ratings"."resource_id" = 110 LIMIT 1
4256
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'Post' and resource_id = '110'
4257
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 110 LIMIT 1
4258
-  (0.1ms) UPDATE "ar_ratings" SET "total" = 20, "average" = 3.7, "sum" = 74, "estimate" = 3.611278519156263, "updated_at" = '2013-05-23 20:08:10.506287' WHERE "ar_ratings"."id" = 84
4259
-  (0.5ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'Post') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'Post')) avg_num_ratings FROM ar_rates WHERE resource_type = 'Post'
4260
-  (0.9ms) commit transaction
4261
-  (0.1ms) SELECT COUNT(*) FROM "ar_ratings" 
4262
-  (0.0ms) begin transaction
4263
- SQL (0.4ms) INSERT INTO "posts" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "consectetur nam modi possimus ipsa"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4264
-  (0.6ms) commit transaction
4265
-  (0.0ms) begin transaction
4266
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Christophe"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4267
-  (0.9ms) commit transaction
4268
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'User' AND "ar_rates"."resource_id" = 242 AND "ar_rates"."author_type" = 'Post' AND "ar_rates"."author_id" = 111 LIMIT 1
4269
-  (0.0ms) begin transaction
4270
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 111 LIMIT 1
4271
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 242 LIMIT 1
4272
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 111 AND "ar_rates"."author_type" = 'Post' AND "ar_rates"."resource_id" = 242 AND "ar_rates"."resource_type" = 'User') LIMIT 1
4273
- SQL (0.4ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 111], ["author_type", "Post"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 242], ["resource_type", "User"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 4]]
4274
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'User' AND "ar_ratings"."resource_id" = 242 LIMIT 1
4275
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'User' and resource_id = '242'
4276
-  (0.4ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'User') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'User') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'User')) avg_num_ratings FROM ar_rates WHERE resource_type = 'User'
4277
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 242 LIMIT 1
4278
- SQL (0.2ms) INSERT INTO "ar_ratings" ("average", "created_at", "estimate", "resource_id", "resource_type", "sum", "total", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["average", #<BigDecimal:7fb2b7544f40,'0.4E1',9(45)>], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["estimate", #<BigDecimal:7fb2b7544d88,'0.4E1',9(45)>], ["resource_id", 242], ["resource_type", "User"], ["sum", 4], ["total", 1], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00]]
4279
-  (0.3ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'User') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'User') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'User')) avg_num_ratings FROM ar_rates WHERE resource_type = 'User'
4280
-  (1.0ms) commit transaction
4281
-  (0.1ms) SELECT COUNT(*) FROM "ar_ratings" 
4282
-  (0.1ms) SELECT COUNT(*) FROM "ar_rates"
4283
-  (0.0ms) begin transaction
4284
- SQL (0.3ms) INSERT INTO "posts" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "ut eligendi ut at sint"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4285
-  (0.8ms) commit transaction
4286
-  (0.0ms) begin transaction
4287
- SQL (0.4ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Santos"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4288
-  (0.8ms) commit transaction
4289
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'User' AND "ar_rates"."resource_id" = 243 AND "ar_rates"."author_type" = 'Post' AND "ar_rates"."author_id" = 112 LIMIT 1
4290
-  (0.0ms) begin transaction
4291
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 112 LIMIT 1
4292
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 243 LIMIT 1
4293
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 112 AND "ar_rates"."author_type" = 'Post' AND "ar_rates"."resource_id" = 243 AND "ar_rates"."resource_type" = 'User') LIMIT 1
4294
- SQL (0.3ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 112], ["author_type", "Post"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 243], ["resource_type", "User"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 4]]
4295
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'User' AND "ar_ratings"."resource_id" = 243 LIMIT 1
4296
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'User' and resource_id = '243'
4297
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 243 LIMIT 1
4298
- SQL (0.2ms) INSERT INTO "ar_ratings" ("average", "created_at", "estimate", "resource_id", "resource_type", "sum", "total", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["average", #<BigDecimal:7fb2b749a4c8,'0.4E1',9(45)>], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["estimate", #<BigDecimal:7fb2b749a310,'0.4E1',9(45)>], ["resource_id", 243], ["resource_type", "User"], ["sum", 4], ["total", 1], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00]]
4299
-  (0.3ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'User') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'User') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'User')) avg_num_ratings FROM ar_rates WHERE resource_type = 'User'
4300
-  (0.8ms) commit transaction
4301
-  (0.1ms) SELECT COUNT(*) FROM "ar_rates" 
4302
-  (0.0ms) begin transaction
4303
- SQL (0.4ms) INSERT INTO "posts" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "nulla dolorem molestias rem architecto"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4304
-  (0.8ms) commit transaction
4305
-  (0.0ms) begin transaction
4306
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Stephan"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4307
-  (0.9ms) commit transaction
4308
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'User' AND "ar_rates"."resource_id" = 244 AND "ar_rates"."author_type" = 'Post' AND "ar_rates"."author_id" = 113 LIMIT 1
4309
-  (0.0ms) begin transaction
4310
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 113 LIMIT 1
4311
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 244 LIMIT 1
4312
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 113 AND "ar_rates"."author_type" = 'Post' AND "ar_rates"."resource_id" = 244 AND "ar_rates"."resource_type" = 'User') LIMIT 1
4313
- SQL (0.4ms) INSERT INTO "ar_rates" ("author_id", "author_type", "created_at", "resource_id", "resource_type", "updated_at", "value") VALUES (?, ?, ?, ?, ?, ?, ?) [["author_id", 113], ["author_type", "Post"], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["resource_id", 244], ["resource_type", "User"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", 4]]
4314
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'User' AND "ar_ratings"."resource_id" = 244 LIMIT 1
4315
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'User' and resource_id = '244'
4316
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 244 LIMIT 1
4317
- SQL (0.2ms) INSERT INTO "ar_ratings" ("average", "created_at", "estimate", "resource_id", "resource_type", "sum", "total", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["average", #<BigDecimal:7fb2b61999a0,'0.4E1',9(45)>], ["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["estimate", #<BigDecimal:7fb2b61997e8,'0.4E1',9(45)>], ["resource_id", 244], ["resource_type", "User"], ["sum", 4], ["total", 1], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00]]
4318
-  (0.3ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'User') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'User') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'User')) avg_num_ratings FROM ar_rates WHERE resource_type = 'User'
4319
-  (1.0ms) commit transaction
4320
-  (0.1ms) SELECT COUNT(*) FROM "ar_ratings"
4321
- ActsRateable::Rate Load (0.1ms) SELECT "ar_rates".* FROM "ar_rates" WHERE "ar_rates"."resource_type" = 'User' AND "ar_rates"."resource_id" = 244 AND "ar_rates"."author_type" = 'Post' AND "ar_rates"."author_id" = 113 LIMIT 1
4322
-  (0.0ms) begin transaction
4323
- Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = 113 LIMIT 1
4324
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 244 LIMIT 1
4325
- ActsRateable::Rate Exists (0.1ms) SELECT 1 AS one FROM "ar_rates" WHERE ("ar_rates"."author_id" = 113 AND "ar_rates"."id" != 236 AND "ar_rates"."author_type" = 'Post' AND "ar_rates"."resource_id" = 244 AND "ar_rates"."resource_type" = 'User') LIMIT 1
4326
- ActsRateable::Rating Load (0.1ms) SELECT "ar_ratings".* FROM "ar_ratings" WHERE "ar_ratings"."resource_type" = 'User' AND "ar_ratings"."resource_id" = 244 LIMIT 1
4327
-  (0.1ms) SELECT COUNT(*) total_ratings, COALESCE(SUM(value),0) rating_sum, COALESCE(AVG(value),0) rating_avg FROM ar_rates WHERE resource_type = 'User' and resource_id = '244'
4328
- User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 244 LIMIT 1
4329
-  (0.3ms) SELECT COUNT(*) total_ratings, SUM(value) rating_sum, AVG(value) rating_avg, (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'User') rated_count, ((SELECT COUNT(*) from ar_rates WHERE resource_type = 'User') / (SELECT COUNT(DISTINCT resource_id) FROM ar_rates WHERE resource_type = 'User')) avg_num_ratings FROM ar_rates WHERE resource_type = 'User'
4330
-  (0.0ms) commit transaction
4331
-  (0.1ms) SELECT COUNT(*) FROM "ar_ratings" 
4332
-  (0.0ms) begin transaction
4333
- SQL (0.4ms) INSERT INTO "posts" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "beatae iusto sunt aut saepe"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4334
-  (0.7ms) commit transaction
4335
-  (0.0ms) begin transaction
4336
- SQL (0.3ms) INSERT INTO "posts" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "culpa ut laboriosam eaque itaque"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4337
-  (0.8ms) commit transaction
4338
-  (0.0ms) begin transaction
4339
- SQL (0.3ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Lucious"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4340
-  (0.9ms) commit transaction
4341
-  (0.0ms) begin transaction
4342
- SQL (0.4ms) INSERT INTO "posts" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "reprehenderit pariatur veniam ipsam cumque"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4343
-  (0.8ms) commit transaction
4344
-  (0.0ms) begin transaction
4345
- SQL (0.4ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Lelia"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4346
-  (1.0ms) commit transaction
4347
-  (0.0ms) begin transaction
4348
- SQL (0.3ms) INSERT INTO "posts" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "consectetur nam modi possimus ipsa"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4349
-  (0.7ms) commit transaction
4350
-  (0.0ms) begin transaction
4351
- SQL (0.4ms) INSERT INTO "users" ("created_at", "name", "updated_at", "value") VALUES (?, ?, ?, ?) [["created_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["name", "Christophe"], ["updated_at", Thu, 23 May 2013 20:08:10 UTC +00:00], ["value", nil]]
4352
-  (0.9ms) commit transaction
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_rateable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
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: 2013-05-23 00:00:00.000000000 Z
12
+ date: 2013-05-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails