Sha256: c41a1664fbd0fccfb9dcad5668ce38784a3eb3a317cf8cbc4bf9e861bafe57ae
Contents?: true
Size: 666 Bytes
Versions: 1
Compression:
Stored size: 666 Bytes
Contents
class ActivitiesController < AuthorizedController belongs_to :project, :optional => true has_scope :by_date def new # Allow callers specifying defaults if params[:activity] @activity = Activity.new(params[:activity]) else @activity = Activity.new(:date => Date.today) end # Educated guessing of person @activity.person = current_user.person if current_user # Educated guessing of project @activity.project_id ||= params[:project_id] if params[:project_id] @activity.project_id ||= @activity.person.activities.order(:duration_to).last new! end def create create! { @activity.project } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
bookyt_projects-0.11.2 | app/controllers/activities_controller.rb |