likes_tracker 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +4 -0
- data/Gemfile +1 -1
- data/README.md +2 -2
- data/lib/likes_tracker.rb +1 -1
- data/lib/likes_tracker/version.rb +1 -1
- data/spec/dummy/config/initializers/redis.rb +5 -2
- metadata +4 -2
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# LikesTracker
|
1
|
+
# LikesTracker [![Build Status](https://secure.travis-ci.org/apeacox/likes_tracker.png)](http://travis-ci.org/apeacox/likes_tracker)
|
2
2
|
|
3
3
|
A Rails gem to track *likes* between two ```ActiveModel``` compliant models. A common use case might be that a User likes a Post.
|
4
4
|
|
@@ -122,7 +122,7 @@ Last but not least, here there're the remaining methods and examples:
|
|
122
122
|
|
123
123
|
## Contributing
|
124
124
|
|
125
|
-
1. Fork it
|
125
|
+
1. Fork it!
|
126
126
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
127
127
|
3. Commit your changes (`git commit -am 'Added some feature'`)
|
128
128
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/lib/likes_tracker.rb
CHANGED
@@ -74,7 +74,7 @@ module LikesTracker
|
|
74
74
|
blk = ->(klass, params) { block.call(klass, params) }
|
75
75
|
blk.call(self, most_liked_ids)
|
76
76
|
else
|
77
|
-
self.where(id: most_liked_ids)
|
77
|
+
self.where(id: most_liked_ids).order(most_liked_ids.map {|id| "id = #{id} DESC"}.join(','))
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: likes_tracker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
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-
|
12
|
+
date: 2012-09-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -83,6 +83,7 @@ extensions: []
|
|
83
83
|
extra_rdoc_files: []
|
84
84
|
files:
|
85
85
|
- .gitignore
|
86
|
+
- .travis.yml
|
86
87
|
- Gemfile
|
87
88
|
- LICENSE
|
88
89
|
- README.md
|
@@ -191,3 +192,4 @@ test_files:
|
|
191
192
|
- spec/likes_tracker_spec.rb
|
192
193
|
- spec/spec_helper.rb
|
193
194
|
- spec/support/factories.rb
|
195
|
+
has_rdoc:
|