Commit Graph
10 Commits
Author SHA1 Message Date
Daniel O'Connorandgoogle-labs-jules[bot] a349ce784a Optimize Like lookups in Likeable concern (#4799)
- Update liked_by? to return false if member is nil and use likes.exists?(member_id: member.id) instead of allocating login name arrays.
- Simplify liked_by_members_names to use members.pluck(:login_name).
- Update app/views/photos/_likes.html.haml to use photo.liked_by?(current_member).
- Add unit tests for liked_by? in spec/models/like_spec.rb.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-09-20 13:46:02 +09:30
Brenda Wallace 63ea6752fa likes reading from hash from elastic 2020-01-01 08:40:04 +13:00
codefactor-io e8760f9c38 [CodeFactor] Apply fixes 2019-12-20 03:33:23 +00:00
Brenda Wallace 719fec24d0 if someone is destroy, delete all likes 2019-09-27 08:13:07 +12:00
Brenda Wallace b654fd483b counter cache was on the wrong side of the relationship 2019-07-15 11:58:46 +00:00
Brenda Wallace acf58fc5e2 Choose crop photos by most liked 2019-07-15 11:58:46 +00:00
Brenda Wallace a87248a43e DRY up detecting if photo/post already liked 2019-07-12 09:42:45 +12:00
Brenda Wallace 510124758d Inverse relation ships 2018-10-16 13:26:54 +13:00
Daniel O'Connor 2594e5d334 Rubocop 2016-12-09 12:06:14 +10:30
Daniel O'Connor 77e95ad344 Shift to concerns 2016-06-04 21:02:50 +09:30