bookyt_salary 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,8 @@ class SalaryTemplatesController < AuthorizedController
3
3
  # Duplicate original record
4
4
  template = resource.dup
5
5
 
6
- # Rebuild positions
6
+ # Rebuild salary items
7
+ template.salary_items = resource.salary_items.map{|salary_item| salary_item.dup}
7
8
  set_resource_ivar template
8
9
 
9
10
  render 'edit'
@@ -17,9 +18,7 @@ class SalaryTemplatesController < AuthorizedController
17
18
  @salary_template = resource_class.new
18
19
  end
19
20
 
20
- @salary_item = @salary_template.salary_items.build(
21
- :times => 1
22
- )
21
+ @salary_item = @salary_template.salary_items.build
23
22
 
24
23
  respond_with @salary_item
25
24
  end
@@ -4,4 +4,8 @@ class SalaryTemplate < ActiveRecord::Base
4
4
  # Salary Items
5
5
  has_many :salary_items
6
6
  accepts_nested_attributes_for :salary_items, :allow_destroy => true
7
+
8
+ def to_s
9
+ title
10
+ end
7
11
  end
@@ -0,0 +1,8 @@
1
+ .contextual
2
+ = contextual_link_to :copy
3
+ = contextual_links_for
4
+
5
+ .page-header
6
+ %h1= resource
7
+
8
+ = render 'form'
data/config/routes.rb CHANGED
@@ -8,6 +8,10 @@ Rails.application.routes.draw do
8
8
 
9
9
  resources :salary_templates do
10
10
  member do
11
+ get :copy
12
+ get :new_salary_item
13
+ end
14
+ collection do
11
15
  get :new_salary_item
12
16
  end
13
17
  end
@@ -1,3 +1,3 @@
1
1
  module BookytSalary
2
- VERSION = '0.9.0'
2
+ VERSION = '0.9.1'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bookyt_salary
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
4
+ hash: 57
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 0
10
- version: 0.9.0
9
+ - 1
10
+ version: 0.9.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Simon H\xC3\xBCrlimann (CyT)"
@@ -129,6 +129,7 @@ files:
129
129
  - app/views/salary_templates/_salary_item_form.html.haml
130
130
  - app/views/salary_templates/_salary_template.html.haml
131
131
  - app/views/salary_templates/new_salary_item.js.erb
132
+ - app/views/salary_templates/show.html.haml
132
133
  - config/application.rb
133
134
  - config/boot.rb
134
135
  - config/locales/bookyt_salary.de.yml
@@ -174,9 +175,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
175
  requirements: []
175
176
 
176
177
  rubyforge_project:
177
- rubygems_version: 1.8.15
178
+ rubygems_version: 1.8.10
178
179
  signing_key:
179
180
  specification_version: 3
180
181
  summary: Salary plugin for bookyt
181
182
  test_files: []
182
183
 
184
+ has_rdoc: