Skip to content

Commit

Permalink
Add tags reference for Person
Browse files Browse the repository at this point in the history
- Add tags reference to fix acts_as_ordered_taggable_on issues
  • Loading branch information
alienxp03 committed Oct 2, 2017
1 parent 077b115 commit 2f70c14
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions app/models/person.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ class Person < ActiveRecord::Base
avatar_file_name: 1,
bio: 20,
company_name: 1,
email: 15,
email: 15,
featured: 1000,
first_name: 5,
first_name: 5,
gravatar_image_found: 3,
interests: 1,
last_name: 5,
phone: 0,
last_name: 5,
phone: 0,
roles: 1,
skills: 1,
title: 1,
skills: 1,
title: 1,
twitter_username: 5,
website: 1
}
Expand All @@ -37,11 +37,11 @@ class Person < ActiveRecord::Base
scope :featured, -> { where(featured: true) }
scope :not_featured, -> { where(featured: false) }

scope :with_interests, -> { includes(:interests) }
scope :with_skills, -> { includes(:skills) }
scope :with_interests, -> { references(:tags).includes(:interests) }
scope :with_skills, -> { references(:tags).includes(:skills) }
scope :with_news, -> { includes(:news) }
scope :with_events, -> { includes(:events) }
scope :with_associations, -> {
scope :with_associations, -> {
with_events
.with_news
.with_interests
Expand Down

0 comments on commit 2f70c14

Please sign in to comment.