-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance compatibility with Redmine 5
- Loading branch information
Showing
27 changed files
with
216 additions
and
151 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
14 changes: 11 additions & 3 deletions
14
lib/redmine_tiny_features/custom_field_enumeration_patch.rb
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 |
---|---|---|
@@ -1,5 +1,13 @@ | ||
require_dependency 'custom_field_enumeration' | ||
|
||
class CustomFieldEnumeration < ActiveRecord::Base | ||
has_many :disabled_custom_field_enumerations, :dependent => :delete_all | ||
end | ||
module RedmineTinyFeatures | ||
module CustomFieldEnumerationPatch | ||
def self.included(base) | ||
base.class_eval do | ||
has_many :disabled_custom_field_enumerations, :dependent => :delete_all | ||
end | ||
end | ||
end | ||
end | ||
|
||
CustomFieldEnumeration.send(:include, RedmineTinyFeatures::CustomFieldEnumerationPatch) |
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 |
---|---|---|
@@ -1,8 +1,17 @@ | ||
require_dependency 'custom_field' | ||
|
||
class CustomField < ActiveRecord::Base | ||
##### PATCH ,to call the destroy method of (CustomFieldEnumeration has :dependent => :delete_all) | ||
has_many :enumerations, lambda {order(:position)}, | ||
:class_name => 'CustomFieldEnumeration', | ||
:dependent => :destroy | ||
end | ||
module RedmineTinyFeatures | ||
module CustomFieldPatch | ||
def self.included(base) | ||
base.class_eval do | ||
has_many :enumerations, lambda {order(:position)}, | ||
:class_name => 'CustomFieldEnumeration', | ||
:dependent => :destroy | ||
|
||
safe_attributes("steps", "min_value", "max_value") | ||
end | ||
end | ||
end | ||
end | ||
|
||
CustomField.send(:include, RedmineTinyFeatures::CustomFieldPatch) |
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
require_dependency 'issue_statuses_helper' | ||
|
||
module RedmineTinyFeatures | ||
module IssueStatusesHelper | ||
module IssueStatusesHelperPatch | ||
def valid_color_list | ||
IssueStatus.valid_color_list.collect {|o| [l(o.last), o.first]} | ||
end | ||
end | ||
end | ||
|
||
IssueStatusesHelper.prepend RedmineTinyFeatures::IssueStatusesHelper | ||
ActionView::Base.send(:include, IssueStatusesHelper) | ||
IssueStatusesHelper.prepend RedmineTinyFeatures::IssueStatusesHelperPatch | ||
ActionView::Base.send(:include, IssueStatusesHelper) |
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
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
Oops, something went wrong.