Patch #18818

TimeEntry acts_as_activity_provider scope should joins(:project)

Added by Ondřej Ezr almost 4 years ago. Updated over 3 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Code cleanup/refactoring
Target version:3.0.0

Description

TimeEntry acts_as_activity_provider scope should join project, not just preload it

activity_scope_on_time_entry.patch Magnifier (629 Bytes) Ondřej Ezr, 2015-01-13 01:09

Associated revisions

Revision 13971
Added by Jean-Philippe Lang over 3 years ago

TimeEntry acts_as_activity_provider scope should joins(:project) (#18818).

Patch by Ondřej Ezr.

History

#1 Updated by Toshi MARUYAMA over 3 years ago

  • Target version set to 3.0.0

#2 Updated by Jean-Philippe Lang over 3 years ago

  • Subject changed from TimeEntry acts_as_activity_provider scope to TimeEntry acts_as_activity_provider scope should joins(:project)
  • Category set to Code cleanup/refactoring
  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang

Committed in r13971, thanks.

#3 Updated by Toshi MARUYAMA over 3 years ago

For the record:

:scope => preload(:project) was introduced by r13482 (#14534).

=== (+11,-5) app/models/time_entry.rb ===
@@ -35,7 +35,7 @@

   acts_as_activity_provider :timestamp => "#{table_name}.created_on",
                             :author_key => :user_id,
-                            :find_options => {:include => :project}
+                            :scope => preload(:project)

So target 3.0.0 is no need.
But 3.0.0 was already released.

Also available in: Atom PDF