is_rateable 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4093ce3ea4eada68e48e35df444add5de41c9cdc
4
- data.tar.gz: 91432878256fabe132e5d956067cd2615181ccdf
3
+ metadata.gz: a328f75b5a77bdf01743d355f322733bc61d44d1
4
+ data.tar.gz: 923b6560a5fe0e4ddafe6e597b329d40e0ca8956
5
5
  SHA512:
6
- metadata.gz: 9ca5448099940e07a164ef6a57cf5d98bd0ce45af9146924c0ff02841e7225e328e13c8742cdfa3cade14d286d85f3c5d19a9030fbfff3a8697fb1d14dba294b
7
- data.tar.gz: ce82245f88b296124bb19ab3c0c1af6ef8b7ba6bbc87d8ab04428592c851f5ec75ce99534a80d49cb489c25a41f03857b653d78de4a4b18c17ac71425145df20
6
+ metadata.gz: 874c7b4f311bd4ea016d1ba09a71dbaf3464e2de50a51a9742c2a830b00ce8f84b549ea27ae33492f0f6d0a76bdf7bf54bcae4d90f948d6e4ea8dd65bdc93867
7
+ data.tar.gz: cfe2b7fc4dc7bcab59d1f8850f11179e67cbfeaf6f728b1f6fe02a1d5215457e42de3f546fdbb182ca97ad9eb7d121207cb255e92135dd437d3bcb40a3e57f91
@@ -11,6 +11,9 @@ module IsRateable
11
11
 
12
12
  has_many :ratee_ratings, as: :ratee, class_name: 'IsRateable::Rating'
13
13
 
14
+ def above_average_rating(rating)
15
+ joins(:ratee_ratings).merge(Rating.group(:ratee_id, :ratee_type).having('AVG(score) > ?', rating))
16
+ end
14
17
  end
15
18
  end
16
19
 
@@ -1,3 +1,3 @@
1
1
  module IsRateable
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: is_rateable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isaac Norman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-05-27 00:00:00.000000000 Z
11
+ date: 2015-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -162,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
162
  version: '0'
163
163
  requirements: []
164
164
  rubyforge_project:
165
- rubygems_version: 2.4.6
165
+ rubygems_version: 2.4.7
166
166
  signing_key:
167
167
  specification_version: 4
168
168
  summary: 5 star ratings for your Rails models