You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

commit.rb 574 B

​
​
​
​
​
​
​
​
​
​
12345678910111213
  1. class Commit < ActiveRecord::Base
  2. attr_accessible :comments, :committed_on, :committer, :project_id, :repository_id, :version
  3. validates :repository_id, presence: true
  4. validates :version, presence: true, uniqueness: {scope: :repository_id}
  5. validates :committed_on, presence: true
  6. has_many :forge_acts, :class_name => 'ForgeActivity',:as =>:forge_act ,:dependent => :destroy
  7. after_create :act_as_forge_activity
  8. # 项目中提交动态
  9. def act_as_forge_activity
  10. self.forge_acts << ForgeActivity.new(:user_id => 2, :project_id => self.project_id)
  11. end
  12. end

软件技术创新是当今国家整体创新能力的重要基础和发展引擎。近年来,大众参与的软件创新与创业活动已经成为网络时代软件开发和应用的新形态,正在快速改变着全球软件创新模式和软件产业格局。 ...