Skip to content

Instantly share code, notes, and snippets.

View KenYN's full-sized avatar
💭
😪

Ken Yasumoto-Nicolson KenYN

💭
😪
  • Japan
View GitHub Profile
@KenYN
KenYN / scenario.rb
Last active January 3, 2016 22:59
This is a rough outline of how a Scenario for https://github.com/cantino/huginn might be implemented. Note that the Schedule class is left as an exercise to the reader.
class Scenario < ActiveRecord::Base
has_many :agents, :dependent => :destroy, :inverse_of => :scenario
belongs_to :schedule, :inverse_of => :scenarios
belongs_to :user
attr_accessible :description, :name, :scenario
# XML description of scenario - not in DB!
attr_accessor :scenario
# Create a set of rules from the passed in parameters.
# @param current_user the current user