bookmarker 0.0.6 → 0.0.7
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 +1 -1
- data/lib/bookmarker.rb +2 -2
- data/lib/bookmarker/bookmark_maker.rb +1 -3
- data/lib/bookmarker/version.rb +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -3,7 +3,7 @@ Add bookmarks to your models.
|
|
3
3
|
|
4
4
|
* Add gem "bookmarker" to your Gemfile
|
5
5
|
|
6
|
-
* Run generator: rails g
|
6
|
+
* Run generator: rails g bookmarker:install and rake db:migrate
|
7
7
|
|
8
8
|
* Add is_bookmarkable to your bookmarkable model (for example Company)
|
9
9
|
|
data/lib/bookmarker.rb
CHANGED
@@ -7,8 +7,8 @@ $LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
7
7
|
module Bookmarker
|
8
8
|
if defined?(ActiveRecord::Base)
|
9
9
|
require "bookmarker/engine"
|
10
|
-
|
11
|
-
|
10
|
+
require "bookmarker/version"
|
11
|
+
require "bookmarker/engine"
|
12
12
|
require 'bookmarker/extenders/bookmarkable'
|
13
13
|
require 'bookmarker/extenders/bookmark_maker'
|
14
14
|
require 'bookmarker/bookmark'
|
@@ -12,8 +12,6 @@ module Bookmarker
|
|
12
12
|
|
13
13
|
belongs_to :bookmark_maker, :polymorphic => true
|
14
14
|
|
15
|
-
validates_uniqueness_of :bookmark
|
16
|
-
|
17
15
|
has_many :bookmarks, :class_name => "Bookmarker::Bookmark", :as => :bookmark_maker
|
18
16
|
|
19
17
|
aliases.each do |method, links|
|
@@ -47,7 +45,7 @@ module Bookmarker
|
|
47
45
|
end
|
48
46
|
|
49
47
|
def has_in_bookmarks? bookmarkable_instance
|
50
|
-
find_by_instance(bookmarkable_instance)
|
48
|
+
bookmarks = find_by_instance(bookmarkable_instance)
|
51
49
|
bookmarks.size > 0
|
52
50
|
end
|
53
51
|
end
|
data/lib/bookmarker/version.rb
CHANGED