recommendable 1.1.6 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.markdown CHANGED
@@ -1,8 +1,12 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
- 1.1.6 (Current version)
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.5)
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.7)
13
- actionpack (= 3.2.7)
12
+ actionmailer (3.2.8)
13
+ actionpack (= 3.2.8)
14
14
  mail (~> 2.4.4)
15
- actionpack (3.2.7)
16
- activemodel (= 3.2.7)
17
- activesupport (= 3.2.7)
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.7)
26
- activesupport (= 3.2.7)
25
+ activemodel (3.2.8)
26
+ activesupport (= 3.2.8)
27
27
  builder (~> 3.0.0)
28
- activerecord (3.2.7)
29
- activemodel (= 3.2.7)
30
- activesupport (= 3.2.7)
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.7)
34
- activemodel (= 3.2.7)
35
- activesupport (= 3.2.7)
36
- activesupport (3.2.7)
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.7)
65
- actionmailer (= 3.2.7)
66
- actionpack (= 3.2.7)
67
- activerecord (= 3.2.7)
68
- activeresource (= 3.2.7)
69
- activesupport (= 3.2.7)
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.7)
72
- railties (3.2.7)
73
- actionpack (= 3.2.7)
74
- activesupport (= 3.2.7)
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
 
@@ -44,7 +44,7 @@ module Recommendable
44
44
  items = self.find ids
45
45
  return items.first if count == 1
46
46
 
47
- return items.sort { |x, y| ids.index(x.id) <=> ids.index(y.id) }
47
+ return items.sort_by { |item| ids.index(item.id) }
48
48
  end
49
49
 
50
50
  private
@@ -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(&:ignoreable_id)
377
+ ignores.joins(manual_join(klass, 'ignore')).map(&:ignorable_id)
378
378
  else
379
- ignores.where(:ignoreable_type => klass.to_s).map(&:ignoreable_id)
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.sort do |x, y|
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 = {}
@@ -1,7 +1,7 @@
1
1
  module Recommendable
2
2
  MAJOR = 1
3
3
  MINOR = 1
4
- PATCH = 6
4
+ PATCH = 7
5
5
 
6
6
  VERSION = [MAJOR, MINOR, PATCH].join '.'
7
7
  end
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.6
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-03 00:00:00.000000000 Z
12
+ date: 2012-08-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sqlite3