diff --git a/app/models/person.rb b/app/models/person.rb index 1518c64..760371c 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -60,6 +60,14 @@ def full_name "#{first_name} #{last_name}".strip end + def news_items + news + News.where('user_id = ?', user_id) + end + + def event_items + events + Event.where('user_id = ?', user_id) + end + class << self def pdate_profiles_scores diff --git a/app/views/shared/_profile.html.erb b/app/views/shared/_profile.html.erb index 4d1b2b2..66f6abe 100644 --- a/app/views/shared/_profile.html.erb +++ b/app/views/shared/_profile.html.erb @@ -28,25 +28,25 @@ <% end %> <% end %> - <% unless person.news.empty? then %> + <% unless person.news_items.empty? then %>
<% end %> - <% unless person.events.empty? then %> + <% unless person.event_items.empty? then %>