19 lines
408 B
Ruby
19 lines
408 B
Ruby
class Statistic < ActiveRecord::Base
|
|
attr_accessible :description, :name, :status, :user_id, :main_category_id, :sub_category_id, :file_size
|
|
acts_as_attachable
|
|
|
|
validates_presence_of :main_category_id
|
|
|
|
def creator
|
|
User.find self.user_id
|
|
end
|
|
|
|
def main_category
|
|
MainCategory.find self.main_category_id
|
|
end
|
|
|
|
def sub_category
|
|
SubCategory.where(:id => sub_category_id).first
|
|
end
|
|
end
|