bookyt_projects 0.6.1 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -79,7 +79,7 @@ GEM
79
79
  sprockets (2.0.0)
80
80
  hike (~> 1.2)
81
81
  rack (~> 1.0)
82
- tilt (!= 1.3.0, ~> 1.1)
82
+ tilt (~> 1.1, != 1.3.0)
83
83
  thor (0.14.6)
84
84
  tilt (1.3.3)
85
85
  treetop (1.4.10)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.1
1
+ 0.6.3
@@ -1,12 +1,12 @@
1
1
  class ActivitiesController < AuthorizedController
2
- belongs_to :project
2
+ belongs_to :project, :optional => true
3
3
 
4
4
  def new
5
5
  # Allow callers specifying defaults
6
6
  if params[:activity]
7
7
  @activity = Activity.new(params[:activity])
8
8
  else
9
- @activity = Activity.new
9
+ @activity = Activity.new(:when => Date.today)
10
10
  end
11
11
 
12
12
  # Nested resources support
@@ -14,16 +14,11 @@ class ActivitiesController < AuthorizedController
14
14
  # Educated guessing of defaults
15
15
  @activity.person = current_user.person if current_user
16
16
 
17
- @project ||= Project.new
18
-
19
17
  new!
20
18
  end
21
19
 
22
20
  def create
23
- @activity = Activity.create(params[:activity])
24
- @project = @activity.project
25
-
26
- create! { project_path(@project) }
21
+ create! { @activity.project }
27
22
  end
28
23
 
29
24
  def index
@@ -4,9 +4,9 @@ class Activity < ActiveRecord::Base
4
4
 
5
5
  attr_accessor :minutes, :hours
6
6
 
7
- validates :project, :presence => true
8
- validates :person, :presence => true
9
- validates :when, :presence => true
7
+ validates :project, :presence => true, :allow_blank => false
8
+ validates :person, :presence => true, :allow_blank => false
9
+ validates_date :when, :allow_nil => false, :allow_blank => false
10
10
  validates :from, :presence => true, :unless => :hours_minutes
11
11
  validates :to, :presence => true, :unless => :hours_minutes
12
12
  validates_numericality_of :hours, :only_integer => true, :unless => :from
@@ -3,7 +3,7 @@
3
3
  = f.input :person
4
4
  = f.input :project
5
5
  = f.inputs do
6
- = f.input :when, :as => :date_field
6
+ = f.input :when, :as => :date_field, :required => true
7
7
  = f.input :from, :as => :hour_field
8
8
  = f.input :to, :as => :hour_field
9
9
  = f.input :hours
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bookyt_projects}
8
- s.version = "0.6.1"
8
+ s.version = "0.6.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Roman Simecek}]
12
- s.date = %q{2011-10-10}
12
+ s.date = %q{2011-10-11}
13
13
  s.description = %q{Rails engine for project management it's used to extend the functionallity of bookyt.}
14
14
  s.email = %q{roman.simecek@cyt.ch}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bookyt_projects
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 1
10
- version: 0.6.1
9
+ - 3
10
+ version: 0.6.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Roman Simecek
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-10 00:00:00 Z
18
+ date: 2011-10-11 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  requirement: &id001 !ruby/object:Gem::Requirement