mongoid-likeable 3.0.1 → 3.0.2
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/.gitignore +36 -3
- data/CHANGELOG.md +4 -0
- data/lib/mongoid/likeable.rb +6 -6
- data/mongoid-likeable.gemspec +1 -1
- metadata +7 -2
data/.gitignore
CHANGED
@@ -1,5 +1,38 @@
|
|
1
|
+
# Linux.gitignore
|
2
|
+
*~
|
3
|
+
|
4
|
+
# OSX.gitignore
|
5
|
+
.DS_Store
|
6
|
+
.AppleDouble
|
7
|
+
.LSOverride
|
8
|
+
Icon
|
9
|
+
|
10
|
+
# Thumbnails
|
11
|
+
._*
|
12
|
+
|
13
|
+
# Files that might appear on external disk
|
14
|
+
.Spotlight-V100
|
15
|
+
.Trashes
|
16
|
+
|
17
|
+
|
18
|
+
# Ruby.gitignore
|
1
19
|
*.gem
|
2
|
-
|
20
|
+
*.rbc
|
21
|
+
.bundle
|
22
|
+
.config
|
23
|
+
coverage
|
24
|
+
InstalledFiles
|
25
|
+
lib/bundler/man
|
26
|
+
pkg
|
27
|
+
rdoc
|
28
|
+
spec/reports
|
29
|
+
test/tmp
|
30
|
+
test/version_tmp
|
31
|
+
tmp
|
3
32
|
|
4
|
-
#
|
5
|
-
|
33
|
+
# YARD artifacts
|
34
|
+
.yardoc
|
35
|
+
_yardoc
|
36
|
+
doc/
|
37
|
+
|
38
|
+
Gemfile.lock
|
data/CHANGELOG.md
CHANGED
data/lib/mongoid/likeable.rb
CHANGED
@@ -13,18 +13,18 @@ module Mongoid
|
|
13
13
|
def like(liker)
|
14
14
|
id = liker_id(liker)
|
15
15
|
unless liked?(id)
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
inc :likes, 1
|
17
|
+
push :likers, id
|
18
|
+
touch
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
22
|
def unlike(liker)
|
23
23
|
id = liker_id(liker)
|
24
24
|
if liked?(id)
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
inc :likes, -1
|
26
|
+
pull :likers, id
|
27
|
+
touch
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
data/mongoid-likeable.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid-likeable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -153,4 +153,9 @@ rubygems_version: 1.8.25
|
|
153
153
|
signing_key:
|
154
154
|
specification_version: 3
|
155
155
|
summary: Add likes to your Mongoid documents
|
156
|
-
test_files:
|
156
|
+
test_files:
|
157
|
+
- test/models/story.rb
|
158
|
+
- test/models/story_with_timestamps.rb
|
159
|
+
- test/models/user.rb
|
160
|
+
- test/mongoid_likeable_test.rb
|
161
|
+
- test/test_helper.rb
|