socialization 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = Socialization
2
2
 
3
- Socialization is a Ruby Gem that allow any model to Follow and/or Like any other model. This is accomplished through a double polymorphic relationship on the Follow and Like models. But you don't need to know that since all the complexity is hidden from you.
3
+ Socialization is a Ruby Gem that allows any model to Follow and/or Like any other model. This is accomplished through a double polymorphic relationship on the Follow and Like models. But you don't need to know that since all the complexity is hidden from you.
4
4
 
5
5
  == Installation
6
6
 
@@ -15,7 +15,7 @@ module Socialization
15
15
  end
16
16
 
17
17
  def unfollow!(followable)
18
- followable.followers.where(:follower => self).each do |f|
18
+ followable.followings.where(:follower_type => self.class.to_s, :follower_id => self.id).each do |f|
19
19
  f.destroy
20
20
  end
21
21
  end
@@ -15,7 +15,7 @@ module Socialization
15
15
  end
16
16
 
17
17
  def unlike!(likeable)
18
- likeable.likers.where(:liker => self).each do |l|
18
+ likeable.likings.where(:liker_type => self.class.to_s, :liker_id => self.id).each do |l|
19
19
  l.destroy
20
20
  end
21
21
  end
@@ -1,3 +1,3 @@
1
1
  module Socialization
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9
9
  s.email = "carl@carlmercier.com"
10
10
  s.homepage = "https://github.com/cmer/socialization"
11
11
  s.summary = "Easily socialize your app with Likes and Follows"
12
- s.description = "Socialization allow any model to Follow and/or Like any other model. This is accomplished through a double polymorphic relationship on the Follow and Like models. But you don't need to know that since all the complexity is hidden from you."
12
+ s.description = "Socialization allows any model to Follow and/or Like any other model. This is accomplished through a double polymorphic relationship on the Follow and Like models. But you don't need to know that since all the complexity is hidden from you."
13
13
 
14
14
  s.files = `git ls-files`.split("\n")
15
15
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
data/test/follow_test.rb CHANGED
@@ -27,6 +27,9 @@ class FollowTest < Test::Unit::TestCase
27
27
  assert_raise ActiveRecord::RecordInvalid do
28
28
  @u_john.follow!(@c_rick)
29
29
  end
30
+
31
+ assert @u_john.unfollow!(@c_rick)
32
+ assert_equal false, @c_rick.followed_by?(@u_john)
30
33
  end
31
34
 
32
35
  def test_user_following_user
data/test/like_test.rb CHANGED
@@ -36,6 +36,9 @@ class LikeTest < Test::Unit::TestCase
36
36
  assert_raise ActiveRecord::RecordInvalid do
37
37
  @u_john.like!(@m_seven)
38
38
  end
39
+
40
+ assert @u_john.unlike!(@m_seven)
41
+ assert_equal false, @m_seven.liked_by?(@u_john)
39
42
  end
40
43
 
41
44
  def test_user_liking_another_user
metadata CHANGED
@@ -1,102 +1,81 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: socialization
3
- version: !ruby/object:Gem::Version
4
- hash: 23
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.1
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 0
10
- version: 0.2.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Carl Mercier
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-01-15 00:00:00 -05:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2012-01-15 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: activerecord
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70297772455360 !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
33
22
  type: :runtime
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: appraisal
37
23
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70297772455360
25
+ - !ruby/object:Gem::Dependency
26
+ name: appraisal
27
+ requirement: &70297772454940 !ruby/object:Gem::Requirement
39
28
  none: false
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- hash: 3
44
- segments:
45
- - 0
46
- version: "0"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
47
33
  type: :development
48
- version_requirements: *id002
49
- - !ruby/object:Gem::Dependency
50
- name: logger
51
34
  prerelease: false
52
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *70297772454940
36
+ - !ruby/object:Gem::Dependency
37
+ name: logger
38
+ requirement: &70297772454520 !ruby/object:Gem::Requirement
53
39
  none: false
54
- requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- hash: 3
58
- segments:
59
- - 0
60
- version: "0"
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
61
44
  type: :development
62
- version_requirements: *id003
63
- - !ruby/object:Gem::Dependency
64
- name: mocha
65
45
  prerelease: false
66
- requirement: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *70297772454520
47
+ - !ruby/object:Gem::Dependency
48
+ name: mocha
49
+ requirement: &70297772454100 !ruby/object:Gem::Requirement
67
50
  none: false
68
- requirements:
69
- - - ">="
70
- - !ruby/object:Gem::Version
71
- hash: 3
72
- segments:
73
- - 0
74
- version: "0"
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
75
55
  type: :development
76
- version_requirements: *id004
77
- - !ruby/object:Gem::Dependency
78
- name: sqlite3
79
56
  prerelease: false
80
- requirement: &id005 !ruby/object:Gem::Requirement
57
+ version_requirements: *70297772454100
58
+ - !ruby/object:Gem::Dependency
59
+ name: sqlite3
60
+ requirement: &70297772453680 !ruby/object:Gem::Requirement
81
61
  none: false
82
- requirements:
83
- - - ">="
84
- - !ruby/object:Gem::Version
85
- hash: 3
86
- segments:
87
- - 0
88
- version: "0"
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
89
66
  type: :development
90
- version_requirements: *id005
91
- description: Socialization allow any model to Follow and/or Like any other model. This is accomplished through a double polymorphic relationship on the Follow and Like models. But you don't need to know that since all the complexity is hidden from you.
67
+ prerelease: false
68
+ version_requirements: *70297772453680
69
+ description: Socialization allows any model to Follow and/or Like any other model.
70
+ This is accomplished through a double polymorphic relationship on the Follow and
71
+ Like models. But you don't need to know that since all the complexity is hidden
72
+ from you.
92
73
  email: carl@carlmercier.com
93
74
  executables: []
94
-
95
75
  extensions: []
96
-
97
- extra_rdoc_files:
76
+ extra_rdoc_files:
98
77
  - README.rdoc
99
- files:
78
+ files:
100
79
  - .gitignore
101
80
  - Appraisals
102
81
  - Gemfile
@@ -189,41 +168,33 @@ files:
189
168
  - test/follow_test.rb
190
169
  - test/like_test.rb
191
170
  - test/test_helper.rb
192
- has_rdoc: true
193
171
  homepage: https://github.com/cmer/socialization
194
172
  licenses: []
195
-
196
173
  post_install_message:
197
- rdoc_options:
174
+ rdoc_options:
198
175
  - --charset=UTF-8
199
- require_paths:
176
+ require_paths:
200
177
  - lib
201
- required_ruby_version: !ruby/object:Gem::Requirement
178
+ required_ruby_version: !ruby/object:Gem::Requirement
202
179
  none: false
203
- requirements:
204
- - - ">="
205
- - !ruby/object:Gem::Version
206
- hash: 3
207
- segments:
208
- - 0
209
- version: "0"
210
- required_rubygems_version: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - ! '>='
182
+ - !ruby/object:Gem::Version
183
+ version: '0'
184
+ required_rubygems_version: !ruby/object:Gem::Requirement
211
185
  none: false
212
- requirements:
213
- - - ">="
214
- - !ruby/object:Gem::Version
215
- hash: 3
216
- segments:
217
- - 0
218
- version: "0"
186
+ requirements:
187
+ - - ! '>='
188
+ - !ruby/object:Gem::Version
189
+ version: '0'
219
190
  requirements: []
220
-
221
191
  rubyforge_project:
222
- rubygems_version: 1.6.2
192
+ rubygems_version: 1.8.15
223
193
  signing_key:
224
194
  specification_version: 3
225
195
  summary: Easily socialize your app with Likes and Follows
226
- test_files:
196
+ test_files:
227
197
  - test/follow_test.rb
228
198
  - test/like_test.rb
229
199
  - test/test_helper.rb
200
+ has_rdoc: true