diff --git a/init.rb b/init.rb index 9486789..dd9f542 100644 --- a/init.rb +++ b/init.rb @@ -61,6 +61,8 @@ Dispatcher.to_prepare :redmine_contracts do require_dependency 'project' Project.send(:include, RedmineContracts::Patches::ProjectPatch) + require_dependency 'issue' + Issue.send(:include, RedmineContracts::Patches::IssuePatch) end require 'redmine_contracts/hooks/view_layouts_base_html_head_hook' diff --git a/lib/redmine_contracts/patches/issue_patch.rb b/lib/redmine_contracts/patches/issue_patch.rb new file mode 100644 index 0000000..617e21e --- /dev/null +++ b/lib/redmine_contracts/patches/issue_patch.rb @@ -0,0 +1,21 @@ +module RedmineContracts + module Patches + module IssuePatch + def self.included(base) + base.extend(ClassMethods) + + base.send(:include, InstanceMethods) + base.class_eval do + unloadable + belongs_to :deliverable + end + end + + module ClassMethods + end + + module InstanceMethods + end + end + end +end diff --git a/test/unit/lib/redmine_contracts/patches/issue_patch_test.rb b/test/unit/lib/redmine_contracts/patches/issue_patch_test.rb new file mode 100644 index 0000000..9aafaac --- /dev/null +++ b/test/unit/lib/redmine_contracts/patches/issue_patch_test.rb @@ -0,0 +1,9 @@ +require File.dirname(__FILE__) + '/../../../../test_helper' + +class RedmineContracts::Patches::IssueTest < ActionController::TestCase + + context "Issue" do + subject { Issue.new } + should_belong_to :deliverable + end +end