Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/app/models/person.rb b/app/models/person.rb
- index d29bb7a..944c28d 100644
- --- a/app/models/person.rb
- +++ b/app/models/person.rb
- @@ -63,13 +63,13 @@ class Person < User
- end
- def subordinates
- - scope = Person.eager_load(:information).where("#{PeopleInformation.table_name}.manager_id" => id.to_i)
- + scope = Person.includes(:information).where("#{PeopleInformation.table_name}.manager_id" => id.to_i)
- scope = scope.visible if Person.respond_to?(:visible)
- scope
- end
- def available_managers
- - scope = Person.joins(:projects).eager_load(:information).where("#{Person.table_name}.type" => 'User').logged
- + scope = Person.includes(:projects, :information).where("#{Person.table_name}.type" => 'User').logged
- scope = scope.visible if Person.respond_to?(:visible)
- if self.id.present?
- @@ -79,7 +79,7 @@ class Person < User
- end
- def available_subordinates
- - scope = Person.eager_load(:information).where("#{Person.table_name}.type" => 'User').logged
- + scope = Person.includes(:information).where("#{Person.table_name}.type" => 'User').logged
- scope = scope.visible if Person.respond_to?(:visible)
- if self.id.present?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement