socialization 1.2.0 → 1.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: a760308b08f93a8929499b6ba5b1c3d9ddf66b19
4
- data.tar.gz: e5c2ec3cd08861113267525060542682da32eaa7
2
+ SHA256:
3
+ metadata.gz: d9501a281b94d2a30d020b90075669fb384b27ffcd6fa3499afd974af90b3634
4
+ data.tar.gz: 183a8bc0b238e491f9d74822ad23f5777596ae0c8d536d2b0f28ce4eecd4e2b3
5
5
  SHA512:
6
- metadata.gz: f935cb82ad88a7db6c2a09d6d3232e8be9ff276a2b70b2a38cfe5a12941081f265eb0920a78ece38c34deae21632f84e27dd94fe8d4223aaf8b654952c816e5f
7
- data.tar.gz: 4207ebfefb3b53e477a23ff830071708623fd3a540eb26994eee18514ec432890c590bc9cbf02e8dc9289efc334c9d6c63c9c9546ecc23ccb4901c96d3c852c9
6
+ metadata.gz: b2ac47b149bd84943521fdafd9ab0351caa152ab3fa23ece63d769ef63babbaf1204c390d8c2cb6984f650ec2b2ecd13301245960e425b847fadf1840b160637
7
+ data.tar.gz: 4bdc1e3181f17f44e34f0589e2687b48aff01da57ace6da88d499068f45a1124b963d30dce55496af58631284410d12fca9216aae70e83f3a376d32d7ba9dd09
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.2.2
1
+ 2.5.0
data/.travis.yml CHANGED
@@ -1,8 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
- - 2.0.0
5
3
  - 2.1.0
6
4
  - 2.2.2
5
+ - 2.5.0
7
6
 
8
7
  script: bundle exec rake spec
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.1 (April 13, 2018)
4
+
5
+ * You thought this project was dead huh!?
6
+ * Dropped support for old Rubies
7
+ * Can now use column other than `id` as primary key (thanks @joshuairl)
8
+ * Added license to `gemspec` (thanks @reiz)
9
+ * Going forward, only Rails 4+ will officially be supported
10
+
3
11
  ## 1.2 (August 8, 2015)
4
12
 
5
13
  * Support for ActiveRecord counter caches (thanks @samnang)
@@ -52,7 +52,7 @@ module Socialization
52
52
 
53
53
  # Returns an ActiveRecord::Relation of all the followers of a certain type that are following followable
54
54
  def followers_relation(followable, klass, opts = {})
55
- rel = klass.where(:id =>
55
+ rel = klass.where(klass.primary_key =>
56
56
  self.select(:follower_id).
57
57
  where(:follower_type => klass.table_name.classify).
58
58
  where(:followable_type => followable.class.to_s).
@@ -78,7 +78,7 @@ module Socialization
78
78
 
79
79
  # Returns an ActiveRecord::Relation of all the followables of a certain type that are followed by follower
80
80
  def followables_relation(follower, klass, opts = {})
81
- rel = klass.where(:id =>
81
+ rel = klass.where(klass.primary_key =>
82
82
  self.select(:followable_id).
83
83
  where(:followable_type => klass.table_name.classify).
84
84
  where(:follower_type => follower.class.to_s).
@@ -52,7 +52,7 @@ module Socialization
52
52
 
53
53
  # Returns an ActiveRecord::Relation of all the likers of a certain type that are liking likeable
54
54
  def likers_relation(likeable, klass, opts = {})
55
- rel = klass.where(:id =>
55
+ rel = klass.where(klass.primary_key =>
56
56
  self.select(:liker_id).
57
57
  where(:liker_type => klass.table_name.classify).
58
58
  where(:likeable_type => likeable.class.to_s).
@@ -78,7 +78,7 @@ module Socialization
78
78
 
79
79
  # Returns an ActiveRecord::Relation of all the likeables of a certain type that are liked by liker
80
80
  def likeables_relation(liker, klass, opts = {})
81
- rel = klass.where(:id =>
81
+ rel = klass.where(klass.primary_key =>
82
82
  self.select(:likeable_id).
83
83
  where(:likeable_type => klass.table_name.classify).
84
84
  where(:liker_type => liker.class.to_s).
@@ -52,7 +52,7 @@ module Socialization
52
52
 
53
53
  # Returns an ActiveRecord::Relation of all the mentioners of a certain type that are mentioning mentionable
54
54
  def mentioners_relation(mentionable, klass, opts = {})
55
- rel = klass.where(:id =>
55
+ rel = klass.where(klass.primary_key =>
56
56
  self.select(:mentioner_id).
57
57
  where(:mentioner_type => klass.table_name.classify).
58
58
  where(:mentionable_type => mentionable.class.to_s).
@@ -78,7 +78,7 @@ module Socialization
78
78
 
79
79
  # Returns an ActiveRecord::Relation of all the mentionables of a certain type that are mentioned by mentioner
80
80
  def mentionables_relation(mentioner, klass, opts = {})
81
- rel = klass.where(:id =>
81
+ rel = klass.where(klass.primary_key =>
82
82
  self.select(:mentionable_id).
83
83
  where(:mentionable_type => klass.table_name.classify).
84
84
  where(:mentioner_type => mentioner.class.to_s).
@@ -1,3 +1,3 @@
1
1
  module Socialization
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
@@ -10,6 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.homepage = "https://github.com/cmer/socialization"
11
11
  s.summary = "Easily socialize your app with Likes and Follows"
12
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
+ s.license = "MIT"
13
14
 
14
15
  s.files = `git ls-files`.split("\n")
15
16
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
@@ -22,7 +23,7 @@ Gem::Specification.new do |s|
22
23
 
23
24
  s.add_development_dependency "appraisal"
24
25
  s.add_development_dependency "logger"
25
- s.add_development_dependency "rspec", "~> 3.3.0"
26
+ s.add_development_dependency "rspec"
26
27
  s.add_development_dependency "rspec-mocks"
27
28
  s.add_development_dependency "sqlite3"
28
29
  s.add_development_dependency "yard"
@@ -31,9 +31,7 @@ def clear_redis
31
31
  end
32
32
  end
33
33
 
34
- ActiveRecord::Base.configurations = {'sqlite3' => {:adapter => 'sqlite3', :database => ':memory:'}}
35
- ActiveRecord::Base.establish_connection(:sqlite3)
36
-
34
+ ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
37
35
  ActiveRecord::Base.logger = Logger.new(STDERR)
38
36
  ActiveRecord::Base.logger.level = Logger::WARN
39
37
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: socialization
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carl Mercier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-08 00:00:00.000000000 Z
11
+ date: 2018-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 3.3.0
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 3.3.0
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec-mocks
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -296,7 +296,8 @@ files:
296
296
  - spec/victims/mentionable_spec.rb
297
297
  - spec/world_spec.rb
298
298
  homepage: https://github.com/cmer/socialization
299
- licenses: []
299
+ licenses:
300
+ - MIT
300
301
  metadata: {}
301
302
  post_install_message:
302
303
  rdoc_options: []
@@ -314,7 +315,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
314
315
  version: '0'
315
316
  requirements: []
316
317
  rubyforge_project:
317
- rubygems_version: 2.4.5
318
+ rubygems_version: 2.7.3
318
319
  signing_key:
319
320
  specification_version: 4
320
321
  summary: Easily socialize your app with Likes and Follows
@@ -339,4 +340,3 @@ test_files:
339
340
  - spec/victims/likeable_spec.rb
340
341
  - spec/victims/mentionable_spec.rb
341
342
  - spec/world_spec.rb
342
- has_rdoc: false