trustieforge/app/models/option_number.rb

16 lines
625 B
Ruby

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
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
end