修改changeset触发事件
This commit is contained in:
parent
466a25c121
commit
4e4ff4958f
|
@ -57,7 +57,6 @@ class Changeset < ActiveRecord::Base
|
|||
validates :committed_on, presence: true
|
||||
validates :commit_date, presence: true
|
||||
validates :scmid, uniqueness: {scope: :repository_id, allow_nil: true}
|
||||
attr_accessible :type, :project_id, :repository_id, :revision, :committer, :comments, :committed_on
|
||||
scope :visible, lambda {|*args|
|
||||
includes(:repository => :project).where(Project.allowed_to_condition(args.shift || User.current, :view_changesets, *args))
|
||||
}
|
||||
|
@ -66,7 +65,7 @@ class Changeset < ActiveRecord::Base
|
|||
# after_update :be_user_score
|
||||
after_destroy :down_user_score
|
||||
# before_create :before_create_cs
|
||||
after_create :act_as_forge_activity
|
||||
# after_create :act_as_forge_activity
|
||||
|
||||
|
||||
def revision=(r)
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
class AddTypeToChangeset < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :changesets, :project_id, :integer
|
||||
add_column :changesets, :type, :integer, :default => false
|
||||
end
|
||||
end
|
|
@ -17,7 +17,7 @@ namespace :gitlab do
|
|||
(0..pages).each do |page|
|
||||
commits = g.commits(project.gpid, :ref_name => g_default_branch, :page => page)
|
||||
commits.each do |commit|
|
||||
result = Commit.create(:project_id => project.id, :repository_id => project.gpid, :version => commit.id, :committer => commit.author_email, :comments => Redmine::CodesetUtil.to_utf8(commit.title, 'UTF-8'), :committed_on => commit.created_at)
|
||||
Commit.create(:project_id => project.id, :repository_id => project.gpid, :version => commit.id, :committer => commit.author_email, :comments => Redmine::CodesetUtil.to_utf8(commit.title, 'UTF-8'), :committed_on => commit.created_at)
|
||||
end
|
||||
end
|
||||
rescue Exception => e
|
||||
|
|
Loading…
Reference in New Issue