2014-07-24 18:05:37 +08:00
|
|
|
class OptionNumber < ActiveRecord::Base
|
2015-07-07 11:29:40 +08:00
|
|
|
attr_accessible :attachment, :changeset, :document, :follow, :issue_done_ratio, :issues_status, :memo, :messages_for_issues, :post_issue,
|
|
|
|
:praise_by_one, :praise_by_three, :praise_by_two, :replay_for_memo, :replay_for_message, :score_type, :total_score, :tread, :tread_by_one, :tread_by_three, :tread_by_two, :user_id
|
2014-07-24 18:05:37 +08:00
|
|
|
|
2014-08-27 12:00:00 +08:00
|
|
|
def self.get_user_option_number user_id
|
|
|
|
result = nil
|
|
|
|
unless user_id.nil?
|
|
|
|
ons = OptionNumber.find_all_by_user_id(user_id);
|
|
|
|
unless (ons .nil? && ons.count > 0)
|
|
|
|
result = ons.first
|
|
|
|
end
|
|
|
|
end
|
|
|
|
result
|
|
|
|
end
|
2014-07-24 18:05:37 +08:00
|
|
|
end
|