Module: Shared::IsData::Pinnable

Extended by:
ActiveSupport::Concern
Defined in:
app/models/concerns/shared/is_data/pinnable.rb

Overview

Shared code pinning objects (adding them to your pinboard).

Instance Method Summary (collapse)

Instance Method Details

- (Object) pinboard_item_for(user)



15
16
17
# File 'app/models/concerns/shared/is_data/pinnable.rb', line 15

def pinboard_item_for(user)
  user.pinboard_items.for_object(self.metamorphosize).first
end

- (Boolean) pinned?(user)

Returns:

  • (Boolean)


11
12
13
# File 'app/models/concerns/shared/is_data/pinnable.rb', line 11

def pinned?(user)
  user.pinboard_items.for_object(self.metamorphosize).count > 0
end