mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-11 09:17:20 -04:00
BUGFUX: member slug needed on photos, to make link
This commit is contained in:
@@ -26,6 +26,7 @@ module SearchPhotos
|
||||
# owner
|
||||
owner_id: owner_id,
|
||||
owner_login_name: owner.login_name,
|
||||
owner_slug: owner.slug,
|
||||
# counts
|
||||
likes_count: likes_count,
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class Photo < ApplicationRecord
|
||||
joins(:photo_associations).where(photo_associations: { photographable_type: model_name.to_s })
|
||||
}
|
||||
|
||||
delegate :login_name, to: :owner, prefix: true
|
||||
delegate :login_name, :slug, to: :owner, prefix: true
|
||||
|
||||
# This is split into a side-effect free method and a side-effecting method
|
||||
# for easier stubbing and testing.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
%h5.ellipsis
|
||||
= photo_icon
|
||||
= link_to photo.title, photo_path(id: photo.id)
|
||||
%i by #{link_to photo.owner_login_name, member_path(slug: photo.owner_login_name)}
|
||||
%i by #{link_to photo.owner_login_name, member_path(slug: photo.owner_slug)}
|
||||
- if photo.date_taken.present?
|
||||
%small.text-muted
|
||||
%time{datetime: photo.date_taken}= I18n.l(photo.date_taken.to_date)
|
||||
|
||||
Reference in New Issue
Block a user