Author: assaf
Date: Fri Aug 8 18:27:29 2008
New Revision: 684169
URL: http://svn.apache.org/viewvc?rev=684169&view=rev
Log:
Add from previously failed merge.
Modified:
ode/sandbox/singleshot/app/models/activity.rb
ode/sandbox/singleshot/spec/models/activity_spec.rb
Modified: ode/sandbox/singleshot/app/models/activity.rb
URL:
http://svn.apache.org/viewvc/ode/sandbox/singleshot/app/models/activity.rb?rev=684169&r1=684168&r2=684169&view=diff
==============================================================================
--- ode/sandbox/singleshot/app/models/activity.rb (original)
+++ ode/sandbox/singleshot/app/models/activity.rb Fri Aug 8 18:27:29 2008
@@ -37,34 +37,20 @@
!new_record?
end
-<<<<<<< HEAD:app/models/activity.rb
-=======
# Eager loads all activities and their dependents (task, person).
named_scope :with_dependents, :include=>[:task, :person]
->>>>>>> dev:app/models/activity.rb
# Returns activities from all tasks associated with this stakeholder.
named_scope :for_stakeholder, lambda { |person|
{ :joins=>'JOIN stakeholders AS involved ON
involved.task_id=activities.task_id',
:conditions=>["involved.person_id=? AND involved.role != 'excluded'",
person.id],
:order=>'activities.created_at DESC', :group=>'activities.task_id,
activities.person_id, activities.name' } }
-<<<<<<< HEAD:app/models/activity.rb
- named_scope :with_dependents, :include=>[:task, :person]
-
- named_scope :for_dates, lambda { |range|
- case range
- when Date
- range = range.to_time..Time.current.end_of_day
- when Range
- range = range.min.to_time.beginning_of_day..range.max.to_time.end_of_day
-=======
# Returns activities for a range of dates (from..to) or from a given date to
today.
named_scope :for_dates, lambda { |arg|
range = case arg
when Date, Time;
arg.to_time.in_time_zone.beginning_of_day..Time.current.end_of_day
when Range;
arg.first.to_time.in_time_zone.beginning_of_day..arg.last.to_time.in_time_zone.end_of_day
->>>>>>> dev:app/models/activity.rb
end
{ :conditions=>{ :created_at=>range } } }
Modified: ode/sandbox/singleshot/spec/models/activity_spec.rb
URL:
http://svn.apache.org/viewvc/ode/sandbox/singleshot/spec/models/activity_spec.rb?rev=684169&r1=684168&r2=684169&view=diff
==============================================================================
--- ode/sandbox/singleshot/spec/models/activity_spec.rb (original)
+++ ode/sandbox/singleshot/spec/models/activity_spec.rb Fri Aug 8 18:27:29 2008
@@ -75,7 +75,6 @@
end
-
describe 'for_dates' do
it 'should accept time and find all activities since that day' do
Activity.for_dates(3.days.ago).proxy_options[:conditions][:created_at].should ==