删除多余的model tag.rb

This commit is contained in:
fanqiang 2013-08-01 21:47:31 +08:00
parent aaa8a4b94d
commit ee0d8ecb95
1 changed files with 0 additions and 19 deletions

View File

@ -1,19 +0,0 @@
class Tag < ActiveRecord::Base
attr_accessible :content
#添加代码
has_many :projects, :through => :project_tags
has_many :project_tags, :class_name => 'ProjectTags'
#确定content不会被重复写入
validates_uniqueness_of :content
validates_presence_of :content
#添加tag内容
def self.add_content(content)
@tag=Tag.new
@tag.content = content
@tag.save
true
end
end
#添加结束