Created
January 14, 2011 17:40
-
-
Save jloosfelt/779939 to your computer and use it in GitHub Desktop.
Hack to make Redmine-Freshbooks work
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
diff --git a/app/controllers/freshbooks_controller.rb b/app/controllers/freshbooks_controller.rb | |
index 2eb8119..0081aaf 100644 | |
--- a/app/controllers/freshbooks_controller.rb | |
+++ b/app/controllers/freshbooks_controller.rb | |
@@ -2,11 +2,12 @@ class FreshbooksController < ApplicationController | |
unloadable | |
def sync | |
+ @debug_project = [] | |
@client = RedmineFreshbooks.freshbooks_client | |
import_staff | |
import_projects | |
sync_tasks_and_activities | |
- flash[:notice] = "Sync successful" | |
+ flash[:notice] = "Sync successful #{@debug_project.inspect}" | |
redirect_to :controller => 'settings', :action => 'plugin', :id => 'redmine_freshbooks' | |
end | |
@@ -133,7 +134,7 @@ class FreshbooksController < ApplicationController | |
def add_project_from_hash(project_hash) | |
project_hash['freshbooks_staff_members'] = [] | |
- | |
+ @debug_project << project_hash | |
if project_hash['staff'].kind_of? Array | |
project_hash['staff'].each do |member_id| | |
staff_mem = FreshbooksStaffMember.find_by_staff_id member_id['staff_id'] | |
diff --git a/db/migrate/004_create_freshbooks_staff_members.rb b/db/migrate/004_create_freshbooks_staff_members.rb | |
index b969e10..5404fb0 100644 | |
--- a/db/migrate/004_create_freshbooks_staff_members.rb | |
+++ b/db/migrate/004_create_freshbooks_staff_members.rb | |
@@ -5,7 +5,7 @@ class CreateFreshbooksStaffMembers < ActiveRecord::Migration | |
t.column :staff_id, :int | |
t.column :country, :string | |
t.column :street1, :string | |
- t.column :username, :sring | |
+ t.column :username, :string | |
t.column :rate, :decimal, :precision => 15, :scale => 2 | |
t.column :street2, :string | |
t.column :business_phone, :string | |
diff --git a/init.rb b/init.rb | |
index 2aebd3f..661a974 100644 | |
--- a/init.rb | |
+++ b/init.rb | |
@@ -1,3 +1,16 @@ | |
+require_dependency 'vendor/plugins/acts_as_customizable/init' | |
+require_dependency 'vendor/plugins/acts_as_list/init' | |
+require_dependency 'vendor/plugins/acts_as_event/init' | |
+require_dependency 'vendor/plugins/acts_as_activity_provider/init' | |
+require_dependency 'vendor/plugins/acts_as_searchable/init' | |
+require_dependency 'vendor/plugins/awesome_nested_set/init' | |
+require_dependency 'vendor/plugins/acts_as_attachable/init' | |
+require_dependency 'vendor/plugins/acts_as_watchable/init' | |
+ | |
+require_dependency 'issue' | |
+require_dependency 'changeset' |
lol ! Because that's very dirty !
I made some urgent modification on the fork but I don't know if my corrections are clean.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why isnt this done on a fork of the repo, and a pull request made?