Unidom Score 评分领域模型引擎
Unidom (UNIfied Domain Object Model) is a series of domain model engines. The Score domain model engine includes the Score Sheet, the Score Sheet Item, the Score Sheet Template, and the Score Sheet Template Item. Unidom (统一领域对象模型)是一系列的领域模型引擎。评分领域模型引擎包括评分表、评分项、评分表模版和评分项模版模型。
Recent Update
Check out the Road Map to find out what's the next. Check out the Change Log to find out what's new.
Usage in Gemfile
gem 'unidom-score'
Run the Database Migration
rake db:migrate
The migration versions start with 200601.
Call the Model
company = Unidom::Party::Company.create! name: 'Xerox'
template = Unidom::Score::ScoreSheetTemplate.create! subject: company, name: 'Survey 2003', total_score: 100
scorer = Unidom::Party::Person.create! name: 'Tim'
score_keeper = Unidom::Party::Shop.create! name: 'WalMart'
score_sheet = Unidom::Score::ScoreSheet.score! scorer: scorer, score_keeper: score_keeper, template: template, name: nil, score: 98, scored_on: Date.current, opened_at: Time.now, description: nil, instruction: nil
# The template could be nil
item_1 = Unidom::Score::ScoreItem.score! sheet: score_sheet, scorer: score_sheet.try(:scorer), template: nil, title: template.try(:title), score: 59, scored_on: Date.current, opened_at: Time.now, description: nil, instruction: nil
item_2 = Unidom::Score::ScoreItem.score! sheet: score_sheet, scorer: score_sheet.try(:scorer), template: nil, title: template.try(:title), score: 39, scored_on: Date.current, opened_at: Time.now, description: nil, instruction: nil