Module: RelationHelpers
- Extended by:
- ActiveSupport::Concern
- Included in:
- Challenge, Comment, Need, PeerReview, Post, Program, Project, Proposal, Space, User, Workgroup
- Defined in:
- app/models/concerns/relation_helpers.rb
Instance Method Summary collapse
- #clappers ⇒ Object
- #claps_count ⇒ Object
- #followers ⇒ Object
- #followers_count ⇒ Object
- #reviews_count ⇒ Object
- #saves_count ⇒ Object
Instance Method Details
#clappers ⇒ Object
14 15 16 |
# File 'app/models/concerns/relation_helpers.rb', line 14 def clappers relations.clapped.select(:user_id) end |
#claps_count ⇒ Object
10 11 12 |
# File 'app/models/concerns/relation_helpers.rb', line 10 def claps_count relations.clapped.size end |
#followers ⇒ Object
22 23 24 |
# File 'app/models/concerns/relation_helpers.rb', line 22 def followers relations.follows.includes(:user).map(&:user) end |
#followers_count ⇒ Object
18 19 20 |
# File 'app/models/concerns/relation_helpers.rb', line 18 def followers_count relations.follows.size end |
#reviews_count ⇒ Object
30 31 32 |
# File 'app/models/concerns/relation_helpers.rb', line 30 def reviews_count relations.reviewed.size end |
#saves_count ⇒ Object
26 27 28 |
# File 'app/models/concerns/relation_helpers.rb', line 26 def saves_count relations.saved.size end |