Class: Need

Inherits:
ApplicationRecord show all
Includes:
AlgoliaSearch, Feedable, Geocodable, Mediumable, Membership, NotificationsHelpers, RecsysHelpers, RelationHelpers, Ressourceable, Skillable, Utils
Defined in:
app/models/need.rb

Instance Method Summary collapse

Methods included from Utils

#obj_type, #reindex, #sanitize, #sanitize_content, #sanitize_description

Methods included from Skillable

#update_skills

Methods included from Ressourceable

#update_ressources

Methods included from RelationHelpers

#clappers, #claps_count, #followers, #followers_count, #reviews_count, #saves_count

Methods included from RecsysHelpers

#add_edge, #remove_edge

Methods included from NotificationsHelpers

#notif_new_follower, #notif_new_member, #notif_pending_member

Methods included from Membership

#admins, #all_owners_admins_members, #has_privacy?, #members, #members_count, #owners, #pending_members, #user_is_member?, #users, #users_sm

Methods included from Feedable

#posts_count

Methods included from Geocodable

#make_address

Instance Method Details



51
52
53
# File 'app/models/need.rb', line 51

def frontend_link
  "/need/#{id}"
end

#notif_new_needObject



39
40
41
42
43
44
45
46
47
48
49
# File 'app/models/need.rb', line 39

def notif_new_need
  Notification.for_group(
    :members,
    args: [project],
    attrs: {
      category: :administration,
      type: 'new_need',
      object: self
    }
  )
end