Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support redmine 4.1.1 and rails (5.2.4.2) #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gem "acts_as_list"
#gem "protected_attributes"
4 changes: 2 additions & 2 deletions app/models/issue_checklist.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class IssueChecklist < ActiveRecord::Base
has_one :comment, as: :commented, dependent: :delete
acts_as_list

attr_accessible :is_done, :subject
attr_protected :id
#attr_accessible :is_done, :subject
# attr_protected :id

validates_presence_of :subject

Expand Down
2 changes: 1 addition & 1 deletion app/views/issues/_checklist.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<% end %>

<% content_for :header_tags do %>
<% if Redmine::VERSION::MAJOR == 3 || (Redmine::VERSION::MAJOR == 2 && Redmine::VERSION::MINOR >= 1) %>
<% if Redmine::VERSION::MAJOR >= 3 || (Redmine::VERSION::MAJOR == 2 && Redmine::VERSION::MINOR >= 1) %>
<%= javascript_include_tag 'jquery.klass.js', plugin: 'redmine_issue_checklist' %>
<%= javascript_include_tag 'issue_checklist.jquery.js', plugin: 'redmine_issue_checklist' %>
<% else %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/issues/_checklist_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


<% content_for :header_tags do %>
<% if Redmine::VERSION::MAJOR == 3 || (Redmine::VERSION::MAJOR == 2 && Redmine::VERSION::MINOR >= 1) %>
<% if Redmine::VERSION::MAJOR >= 3 || (Redmine::VERSION::MAJOR == 2 && Redmine::VERSION::MINOR >= 1) %>
<%= javascript_include_tag 'jquery.klass.js', plugin: 'redmine_issue_checklist' %>
<%= javascript_include_tag 'issue_checklist.jquery.js', plugin: 'redmine_issue_checklist' %>
<% else %>
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20111010202847_create_issue_checklists.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateIssueChecklists < ActiveRecord::Migration
class CreateIssueChecklists < ActiveRecord::Migration[4.2]
def self.up
create_table :issue_checklists do |t|
t.boolean :is_done, default: false
Expand Down
2 changes: 2 additions & 0 deletions init.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
require 'redmine'
require 'acts_as_list'

require 'redmine_issue_checklist/redmine_issue_checklist'


Redmine::Plugin.register :redmine_issue_checklist do
name 'Redmine Issue Checklist Plugin'
author 'Kirill Bezrukov'
Expand Down
4 changes: 3 additions & 1 deletion lib/redmine_issue_checklist/patches/issue_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ module IssuePatch
def self.included(base) # :nodoc:
base.send(:include, InstanceMethods)
base.class_eval do
alias_method_chain :copy_from, :checklist

alias_method :copy_from_without_checklist,:copy_from
alias_method :copy_from, :copy_from_with_checklist
has_many :checklist, class_name: 'IssueChecklist', dependent: :destroy
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ module IssuesControllerPatch
extend ActiveSupport::Concern

included do
alias_method_chain :build_new_issue_from_params, :checklist
# alias_method_chain :build_new_issue_from_params, :checklist
alias_method :build_new_issue_from_params_without_checklist,:build_new_issue_from_params
alias_method :build_new_issue_from_params, :build_new_issue_from_params_with_checklist
end

def build_new_issue_from_params_with_checklist
Expand Down