forked from fernandokosh/redmine_time_tracker
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
time_list_controller now removes unwanted filters from the filter_list make time_bookings belong_to project added missing dependency to time_log => time_bookings (missed "delete_all") added some translations added migration #8 added project_patch cleaned the code
- Loading branch information
Christian Reich
committed
Jul 11, 2012
1 parent
2b0661b
commit 6708242
Showing
8 changed files
with
125 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
class AddProjectidTimebooking < ActiveRecord::Migration | ||
def up | ||
add_column :time_bookings, :project_id, :integer | ||
TimeBooking.all.each do |tb| | ||
if tb.virtual | ||
tb.update_attribute(:project_id, tb.time_log.project_id) | ||
else | ||
tb.update_attribute(:project_id, tb.time_entry.project_id) | ||
end | ||
end | ||
end | ||
|
||
def down | ||
remove_column :time_bookings, :project_id | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module ProjectPatch | ||
def self.included(base) | ||
base.send(:extend, ClassMethods) | ||
base.send(:include, InstanceMethods) | ||
base.class_eval do | ||
has_many :time_bookings, :dependent => :delete_all | ||
end | ||
end | ||
|
||
module ClassMethods | ||
end | ||
|
||
module InstanceMethods | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters