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 +1 -1
- data/VERSION +1 -1
- data/app/controllers/activities_controller.rb +3 -8
- data/app/models/activity.rb +3 -3
- data/app/views/activities/_form.html.haml +1 -1
- data/bookyt_projects.gemspec +2 -2
- metadata +4 -4
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
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
|
24
|
-
@project = @activity.project
|
25
|
-
|
26
|
-
create! { project_path(@project) }
|
21
|
+
create! { @activity.project }
|
27
22
|
end
|
28
23
|
|
29
24
|
def index
|
data/app/models/activity.rb
CHANGED
@@ -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
|
-
|
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
|
data/bookyt_projects.gemspec
CHANGED
@@ -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.
|
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-
|
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:
|
4
|
+
hash: 1
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
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-
|
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
|