Sha256: d9b21ca03042b87c492cef5d18492336e4a1deef75fd6b1e812bdd596045cff6

Contents?: true

Size: 528 Bytes

Versions: 12

Compression:

Stored size: 528 Bytes

Contents

module EnjuBookmark
  module BookmarkUser
    def self.included(base)
      base.extend ClassMethods
    end

    module ClassMethods
      def enju_bookmark_user
        include InstanceMethods
        has_many :bookmarks, :dependent => :destroy
        acts_as_tagger
      end
    end

    module InstanceMethods
      def owned_tags_by_solr
        bookmark_ids = bookmarks.collect(&:id)
        if bookmark_ids.empty?
          []
        else
          Tag.bookmarked(bookmark_ids)
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
enju_bookmark-0.1.2.pre7 lib/enju_bookmark/user.rb
enju_bookmark-0.1.2.pre6 lib/enju_bookmark/user.rb
enju_bookmark-0.1.2.pre5 lib/enju_bookmark/user.rb
enju_bookmark-0.1.2.pre4 lib/enju_bookmark/user.rb
enju_bookmark-0.1.2.pre3 lib/enju_bookmark/user.rb
enju_bookmark-0.1.2.pre2 lib/enju_bookmark/user.rb
enju_bookmark-0.1.2.pre lib/enju_bookmark/user.rb
enju_bookmark-0.1.1 lib/enju_bookmark/user.rb
enju_bookmark-0.1.0.pre lib/enju_bookmark/user.rb
enju_bookmark-0.1.0 lib/enju_bookmark/user.rb
enju_bookmark-0.0.22 lib/enju_bookmark/user.rb
enju_bookmark-0.0.21 lib/enju_bookmark/user.rb