socialforge/app/models/option_number.rb

15 lines
607 B
Ruby
Raw Normal View History

2014-07-24 18:05:37 +08:00
class OptionNumber < ActiveRecord::Base
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-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