fav_star 0.2.0 → 0.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.
- data/VERSION +1 -1
- data/fav_star.gemspec +2 -2
- data/lib/acts_as_faveable.rb +2 -2
- data/lib/fav_star.rb +6 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/fav_star.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{fav_star}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Brady Bouchard"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-09-01}
|
13
13
|
s.description = %q{fav_star provides a fairly straightforward module that allows you to keep track of which models your users have favourited.}
|
14
14
|
s.email = %q{brady@ldawn.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/acts_as_faveable.rb
CHANGED
@@ -7,7 +7,7 @@ module FavStar
|
|
7
7
|
|
8
8
|
module ClassMethods
|
9
9
|
def acts_as_faveable
|
10
|
-
has_many :
|
10
|
+
has_many :faves, :as => :faveable, :dependent => :nullify
|
11
11
|
|
12
12
|
include FavStar::ActsAsFaveable::InstanceMethods
|
13
13
|
extend FavStar::ActsAsFaveable::SingletonMethods
|
@@ -19,7 +19,7 @@ module FavStar
|
|
19
19
|
|
20
20
|
module InstanceMethods
|
21
21
|
|
22
|
-
def
|
22
|
+
def faves
|
23
23
|
Fave.where(:faveable_id => id, :faveable_type => self.class.name).count
|
24
24
|
end
|
25
25
|
|
data/lib/fav_star.rb
CHANGED
@@ -2,4 +2,9 @@ require 'acts_as_faveable'
|
|
2
2
|
require 'acts_as_faver'
|
3
3
|
|
4
4
|
ActiveRecord::Base.send(:include, FavStar::ActsAsFaveable)
|
5
|
-
ActiveRecord::Base.send(:include, FavStar::ActsAsFaver)
|
5
|
+
ActiveRecord::Base.send(:include, FavStar::ActsAsFaver)
|
6
|
+
|
7
|
+
# Inflector gets this wrong, otherwise.
|
8
|
+
ActiveSupport::Inflector.inflections do |i|
|
9
|
+
i.irregular 'fave', 'faves'
|
10
|
+
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 1
|
9
|
+
version: 0.2.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Brady Bouchard
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-09-01 00:00:00 +10:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|