我正在尝试更新旧的Redmine插件但是当我尝试进行迁移时出现此错误。有人可以给我一些指示如何解决这个问题吗?
我尝试将find_options
替换为scope
,但我不确定该怎么做。
rake aborted!
ArgumentError: Unknown key: :find_options. Valid keys are: :type, :permission, :timestamp, :author_key, :scope
/home/developer/projects/redmine/redmine-3.3.1/lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb:32:in `acts_as_activity_provider'
迁移文件:
require File.join(File.dirname(__FILE__), '../../app/models', 'hudson_build')
class UpdateBuilding < ActiveRecord::Migration
def self.up
HudsonBuild.update_all "building = 'true'", "building = 't'"
HudsonBuild.update_all "building = 'false'", "building = 'f'"
end
def self.down
HudsonBuild.update_all "building = 't'", "building = 'true'"
HudsonBuild.update_all "building = 'f'", "building = 'false'"
end
end
导致问题的hudson_build.rb模型的一部分:
require 'hudson_api_error'
require 'hudson_exceptions'
require 'rexml_helper'
include RexmlHelper
class HudsonBuild < ActiveRecord::Base
unloadable
has_many :changesets, :class_name => 'HudsonBuildChangeset', :dependent => :destroy
has_one :test_result, :class_name => 'HudsonBuildTestResult', :dependent => :destroy
has_many :artifacts, :class_name => 'HudsonBuildArtifact', :dependent => :destroy
belongs_to :job, :class_name => 'HudsonJob', :foreign_key => 'hudson_job_id'
belongs_to :author, :class_name => 'User', :foreign_key => 'caused_by'
validates_presence_of :hudson_job_id, :number
validates_uniqueness_of :number, :scope => :hudson_job_id
acts_as_event :title => Proc.new {|o|
retval = "#{l(:label_build)} #{o.job.name} #{o.number}: #{o.result}" unless o.building?
retval = "#{l(:label_build)} #{o.job.name} #{o.number}: #{l(:notice_building)}" if o.building?
retval
},
:description => Proc.new{|o|
items = []
items << o.test_result.description_for_activity if o.test_result != nil
items << HudsonBuildChangeset.description_for_activity(o.changesets) if o.changesets.length > 0
items.join("; ")
},
:datetime => :finished_at
acts_as_activity_provider :type => 'hudson',
:timestamp => "#{HudsonBuild.table_name}.finished_at",
:author_key => "#{HudsonBuild.table_name}.caused_by",
:find_options => {:include => {:job => :project}},
:permission => :view_hudson
include HudsonHelper
extend RexmlHelper