删除多余的model tag.rb
This commit is contained in:
parent
aaa8a4b94d
commit
ee0d8ecb95
|
@ -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
|
||||
#添加结束
|
Loading…
Reference in New Issue