Sha256: d6480b6bf4c30ce8bf0031948711b6b2a03e49d7d2a4b7f3f4e5d7dcad6a26cf

Contents?: true

Size: 589 Bytes

Versions: 5

Compression:

Stored size: 589 Bytes

Contents

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

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

        #attr_accessible :share_bookmarks, as: :admin
      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

5 entries across 5 versions & 1 rubygems

Version Path
enju_bookmark-0.1.3 lib/enju_bookmark/user.rb
enju_bookmark-0.1.2 lib/enju_bookmark/user.rb
enju_bookmark-0.1.2.pre23 lib/enju_bookmark/user.rb
enju_bookmark-0.1.2.pre22 lib/enju_bookmark/user.rb
enju_bookmark-0.1.2.pre21 lib/enju_bookmark/user.rb