recommendable 1.1.6 → 1.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.markdown +5 -1
- data/Gemfile.lock +25 -25
- data/README.markdown +6 -0
- data/lib/recommendable/acts_as_recommendable.rb +1 -1
- data/lib/recommendable/acts_as_recommended_to.rb +3 -5
- data/lib/recommendable/version.rb +1 -1
- metadata +2 -2
data/CHANGELOG.markdown
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
3
|
|
4
|
-
1.1.
|
4
|
+
1.1.7 (Current version)
|
5
5
|
-----------------------
|
6
|
+
* Fix #50, a method that was forgotten to time during the ignoreable => ignorable typo update
|
7
|
+
|
8
|
+
1.1.6
|
9
|
+
-----
|
6
10
|
* Minor code cleanup for my benefit
|
7
11
|
|
8
12
|
1.1.5
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
recommendable (1.1.
|
4
|
+
recommendable (1.1.6)
|
5
5
|
hooks (>= 0.2.1)
|
6
6
|
rails (>= 3.0.0)
|
7
7
|
redis (>= 2.2.0)
|
@@ -9,12 +9,12 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: http://rubygems.org/
|
11
11
|
specs:
|
12
|
-
actionmailer (3.2.
|
13
|
-
actionpack (= 3.2.
|
12
|
+
actionmailer (3.2.8)
|
13
|
+
actionpack (= 3.2.8)
|
14
14
|
mail (~> 2.4.4)
|
15
|
-
actionpack (3.2.
|
16
|
-
activemodel (= 3.2.
|
17
|
-
activesupport (= 3.2.
|
15
|
+
actionpack (3.2.8)
|
16
|
+
activemodel (= 3.2.8)
|
17
|
+
activesupport (= 3.2.8)
|
18
18
|
builder (~> 3.0.0)
|
19
19
|
erubis (~> 2.7.0)
|
20
20
|
journey (~> 1.0.4)
|
@@ -22,18 +22,18 @@ GEM
|
|
22
22
|
rack-cache (~> 1.2)
|
23
23
|
rack-test (~> 0.6.1)
|
24
24
|
sprockets (~> 2.1.3)
|
25
|
-
activemodel (3.2.
|
26
|
-
activesupport (= 3.2.
|
25
|
+
activemodel (3.2.8)
|
26
|
+
activesupport (= 3.2.8)
|
27
27
|
builder (~> 3.0.0)
|
28
|
-
activerecord (3.2.
|
29
|
-
activemodel (= 3.2.
|
30
|
-
activesupport (= 3.2.
|
28
|
+
activerecord (3.2.8)
|
29
|
+
activemodel (= 3.2.8)
|
30
|
+
activesupport (= 3.2.8)
|
31
31
|
arel (~> 3.0.2)
|
32
32
|
tzinfo (~> 0.3.29)
|
33
|
-
activeresource (3.2.
|
34
|
-
activemodel (= 3.2.
|
35
|
-
activesupport (= 3.2.
|
36
|
-
activesupport (3.2.
|
33
|
+
activeresource (3.2.8)
|
34
|
+
activemodel (= 3.2.8)
|
35
|
+
activesupport (= 3.2.8)
|
36
|
+
activesupport (3.2.8)
|
37
37
|
i18n (~> 0.6)
|
38
38
|
multi_json (~> 1.0)
|
39
39
|
arel (3.0.2)
|
@@ -61,17 +61,17 @@ GEM
|
|
61
61
|
rack
|
62
62
|
rack-test (0.6.1)
|
63
63
|
rack (>= 1.0)
|
64
|
-
rails (3.2.
|
65
|
-
actionmailer (= 3.2.
|
66
|
-
actionpack (= 3.2.
|
67
|
-
activerecord (= 3.2.
|
68
|
-
activeresource (= 3.2.
|
69
|
-
activesupport (= 3.2.
|
64
|
+
rails (3.2.8)
|
65
|
+
actionmailer (= 3.2.8)
|
66
|
+
actionpack (= 3.2.8)
|
67
|
+
activerecord (= 3.2.8)
|
68
|
+
activeresource (= 3.2.8)
|
69
|
+
activesupport (= 3.2.8)
|
70
70
|
bundler (~> 1.0)
|
71
|
-
railties (= 3.2.
|
72
|
-
railties (3.2.
|
73
|
-
actionpack (= 3.2.
|
74
|
-
activesupport (= 3.2.
|
71
|
+
railties (= 3.2.8)
|
72
|
+
railties (3.2.8)
|
73
|
+
actionpack (= 3.2.8)
|
74
|
+
activesupport (= 3.2.8)
|
75
75
|
rack-ssl (~> 1.3.2)
|
76
76
|
rake (>= 0.8.7)
|
77
77
|
rdoc (~> 3.4)
|
data/README.markdown
CHANGED
@@ -91,6 +91,12 @@ Users.all.each do |user|
|
|
91
91
|
end
|
92
92
|
```
|
93
93
|
|
94
|
+
Why not stars?
|
95
|
+
--------------
|
96
|
+
I'll let Randall Munroe of [XKCD](http://xkcd.com/) take this one for me:
|
97
|
+
|
98
|
+
[![I got lost and wandered into the world's creepiest cemetery, where the headstones just had names and star ratings. Freaked me out. When I got home I tried to leave the cemetery a bad review on Yelp, but as my hand hovered over the 'one star' button I felt this distant chill ...](http://imgs.xkcd.com/comics/star_ratings.png)](http://xkcd.com/1098/)
|
99
|
+
|
94
100
|
Contributing to recommendable
|
95
101
|
-----------------------------
|
96
102
|
|
@@ -374,9 +374,9 @@ module Recommendable
|
|
374
374
|
# @return [ActiveRecord::Relation] an ActiveRecord::Relation of records that self has ignored
|
375
375
|
def ignored_for klass
|
376
376
|
ids = if klass.sti?
|
377
|
-
ignores.joins(manual_join(klass, 'ignore')).map(&:
|
377
|
+
ignores.joins(manual_join(klass, 'ignore')).map(&:ignorable_id)
|
378
378
|
else
|
379
|
-
ignores.where(:
|
379
|
+
ignores.where(:ignorable_type => klass.to_s).map(&:ignorable_id)
|
380
380
|
end
|
381
381
|
|
382
382
|
klass.where('ID IN (?)', ids)
|
@@ -414,9 +414,7 @@ module Recommendable
|
|
414
414
|
raters = Recommendable.user_class.find rater_ids
|
415
415
|
|
416
416
|
# The query loses the ordering, so...
|
417
|
-
return raters.
|
418
|
-
rater_ids.index(x.id) <=> rater_ids.index(y.id)
|
419
|
-
end
|
417
|
+
return raters.sort_by { |rater| rater_ids.index(rater.id) }
|
420
418
|
end
|
421
419
|
|
422
420
|
def liked_in_common_with rater, options = {}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recommendable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.7
|
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: 2012-08-
|
12
|
+
date: 2012-08-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sqlite3
|