2015-05-19 10:20:07 +08:00
|
|
|
class HomeworkDetailPrograming < ActiveRecord::Base
|
|
|
|
attr_accessible :language, :standard_code, :homework_common_id
|
|
|
|
|
|
|
|
belongs_to :homework_common
|
2015-08-28 12:04:49 +08:00
|
|
|
|
|
|
|
def language_name
|
2015-09-24 15:09:15 +08:00
|
|
|
%W(C C++ Python Java).at(self.language.to_i - 1)
|
2015-08-28 12:04:49 +08:00
|
|
|
end
|
2015-05-19 10:20:07 +08:00
|
|
|
end
|