Skip to content

Commit

Permalink
Count impression on latest photo when homepage is loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
janosrusiczki committed Apr 9, 2023
1 parent c594978 commit b0a926a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/graphql/types/query_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ def album(id:)
# Homepage

def latest_photo
object ? object[:latest_photo] : Photo.order(imported_at: :desc).first
latest_photo = object ? object[:latest_photo] : Photo.order(imported_at: :desc).first
context[:impressionist].call(latest_photo, 'graphql', unique: [:session_hash])
latest_photo
end

def random_photo
Expand Down

0 comments on commit b0a926a

Please sign in to comment.