Initial Commit
This commit is contained in:
9
app/models/asset.rb
Executable file
9
app/models/asset.rb
Executable file
@@ -0,0 +1,9 @@
|
||||
class Asset < ActiveRecord::Base
|
||||
validates_presence_of :tag, :category
|
||||
has_many :comments
|
||||
has_many :softwares
|
||||
|
||||
def tag_with_name
|
||||
"#{tag} - #{name}"
|
||||
end
|
||||
end
|
||||
4
app/models/comment.rb
Executable file
4
app/models/comment.rb
Executable file
@@ -0,0 +1,4 @@
|
||||
class Comment < ActiveRecord::Base
|
||||
validates_presence_of :commenter, :body
|
||||
belongs_to :asset
|
||||
end
|
||||
4
app/models/software.rb
Executable file
4
app/models/software.rb
Executable file
@@ -0,0 +1,4 @@
|
||||
class Software < ActiveRecord::Base
|
||||
validates_presence_of :version, :platform
|
||||
belongs_to :asset
|
||||
end
|
||||
9
app/models/user.rb
Executable file
9
app/models/user.rb
Executable file
@@ -0,0 +1,9 @@
|
||||
class User < ActiveRecord::Base
|
||||
# Include default devise modules. Others available are:
|
||||
# :http_authenticatable, :token_authenticatable, :confirmable, :recoverable, :lockable,
|
||||
# :registerable, :timeoutable, :activatable, :registerable
|
||||
devise :database_authenticatable, :rememberable, :trackable, :validatable
|
||||
|
||||
# Setup accessible (or protected) attributes for your model
|
||||
attr_accessible :name, :email, :password, :password_confirmation
|
||||
end
|
||||
Reference in New Issue
Block a user