fav_star 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/fav_star.gemspec +1 -1
- data/lib/acts_as_faver.rb +1 -1
- data/lib/generators/fav_star/templates/migration.rb +6 -4
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
data/fav_star.gemspec
CHANGED
data/lib/acts_as_faver.rb
CHANGED
@@ -8,7 +8,7 @@ module FavStar #:nodoc:
|
|
8
8
|
module ClassMethods
|
9
9
|
def acts_as_faver
|
10
10
|
|
11
|
-
has_many :
|
11
|
+
has_many :faves, :as => :faver, :dependent => :destroy
|
12
12
|
|
13
13
|
include FavStar::ActsAsFaver::InstanceMethods
|
14
14
|
extend FavStar::ActsAsFaver::SingletonMethods
|
@@ -7,9 +7,11 @@ class FavStarMigration < ActiveRecord::Migration
|
|
7
7
|
t.timestamps
|
8
8
|
end
|
9
9
|
|
10
|
-
add_index :faves, [
|
11
|
-
add_index :faves, [
|
12
|
-
|
10
|
+
add_index :faves, [:faver_id, :faver_type]
|
11
|
+
add_index :faves, [:faveable_id, :faveable_type]
|
12
|
+
|
13
|
+
# Only one fave per user, per model.
|
14
|
+
add_index :faves, [:faver_id, :faver_type, :faveable_id, :faveable_type], :unique => true, :name => 'fk_one_fave_per_user_per_model'
|
13
15
|
|
14
16
|
end
|
15
17
|
|
@@ -19,4 +21,4 @@ class FavStarMigration < ActiveRecord::Migration
|
|
19
21
|
|
20
22
|
end
|
21
23
|
|
22
|
-
end
|
24
|
+
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 1
|
9
|
+
version: 0.3.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-09-20 00:00:00
|
17
|
+
date: 2010-09-20 00:00:00 -06:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|