acts_as_followable 0.1.5 → 0.1.6

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/README.rdoc CHANGED
@@ -114,5 +114,5 @@ You can also query Follow model records like this:
114
114
 
115
115
  == Contributors
116
116
 
117
- + {xpepermint}[http://github.com/xpepermint] (Author)
118
- + {afhammad}[http://github.com/afhammad]
117
+ * {xpepermint}[http://github.com/xpepermint] (Author)
118
+ * {afhammad}[http://github.com/afhammad]
@@ -0,0 +1,9 @@
1
+ class Follow < ActiveRecord::Base
2
+ belongs_to :followable, :polymorphic => true
3
+ belongs_to :follower, :polymorphic => true
4
+
5
+ scope :for_follower_type, lambda { |follower_type| where("follower_type = ?", follower_type) }
6
+ scope :for_followable_type, lambda { |followable_type| where("followable_type = ?", followable_type) }
7
+ scope :for_follower, lambda { |follower| where(["follower_id = ?", follower.id]).for_follower_type(follower.class.name) }
8
+ scope :for_followable, lambda { |followable| where(["followable_id = ?", followable.id]).for_followable_type(followable.class.name) }
9
+ end
@@ -1,10 +1,9 @@
1
1
  %w( acts_as_followable/version
2
- acts_as_followable/followable
2
+ acts_as_followable/followable
3
+ ../app/models/follow
3
4
  ).each do |lib|
4
5
  require File.join(File.dirname(__FILE__), lib)
5
6
  end
6
-
7
- require File.join(File.dirname(__FILE__), '..', 'app', 'models', 'follow.rb')
8
- require File.join(Rails.root, 'app', 'models', 'follow.rb') rescue nil
7
+ require File.join(Rails.root, 'app', 'models', 'follow') rescue nil
9
8
 
10
9
  ActiveRecord::Base.send(:include, ActsAsFollowable::Followable)
@@ -2,7 +2,7 @@ module ActsAsFollowable
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 5
5
+ TINY = 6
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_followable
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
5
- prerelease: false
4
+ hash: 23
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 5
10
- version: 0.1.5
9
+ - 6
10
+ version: 0.1.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kristijan Sedlak
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-15 00:00:00 +01:00
18
+ date: 2011-03-09 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -30,6 +30,7 @@ extra_rdoc_files:
30
30
  - MIT-LICENSE
31
31
  files:
32
32
  - Rakefile
33
+ - app/models/follow.rb
33
34
  - lib/acts_as_followable/followable.rb
34
35
  - lib/acts_as_followable/version.rb
35
36
  - lib/acts_as_followable.rb
@@ -80,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
81
  requirements: []
81
82
 
82
83
  rubyforge_project:
83
- rubygems_version: 1.3.7
84
+ rubygems_version: 1.6.1
84
85
  signing_key:
85
86
  specification_version: 3
86
87
  summary: ActsAsFollowable - Model following.