This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A user creates Spaces (rooms), Items (things), and Profiles (people). | |
Reservations are used to schedule times when these three models are in use and cannot be used elsewhere. | |
Since the modeling of a thing that can only be in use in one place/activity is common to Spaces, Items, and Profiles, this common functionality makes up the polymorphic model Resource. | |
Reservation | |
belongs_to :manager, :class_name => "Profile" | |
has_many :reservation_lines, :before_add => :set_nest, :dependent => :destroy | |
has_many :profiles, :through => :reservation_lines, :source => :reservable, :source_type => 'Profile' | |
has_many :spaces, :through => :reservation_lines, :source => :reservable, :source_type => 'Space' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
== Activity Model == | |
has_many :rule_assignments, :dependent => :destroy # RuleAssignment has activity_id, and rule_type, rule_id | |
has_many :be_located_in_rules, :through => :rule_assignments, :source => :rule, :source_type => 'BeLocatedInRule' | |
== BeLocatedInRules Controller == | |
def create | |
@rule = @activity.be_located_in_rules.build(params[:be_located_in_rule]) | |
... | |
@rule.save # successfully create the BeLocatedInRule, but no join model (RuleAssignment) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN"> | |
<html> | |
<head> | |
<style type="text/css"> | |
#flag { url(images/heartseedLightImage2.jpg) no-repeat } | |
#green { background:green; display:block; float: left; width: 100px } | |
#white { background:yellow; display:block; float: left; width: 100px } | |
#red { background:red; display:block; float: left; width: 100px } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Attempting fallback | |
0:00:05.293557425 8185 0xe5f730 DEBUG basesrc gstbasesrc.c:3104:gst_base_src_change_state:<v4l2src0> PLAYING->PAUSED | |
0:00:05.293593887 8185 0xe5f730 DEBUG basesrc gstbasesrc.c:2895:gst_base_src_set_playing:<v4l2src0> unlock | |
0:00:05.293610433 8185 0xe5f730 LOG v4l2src gstv4l2src.c:749:gst_v4l2src_unlock:<v4l2src0> Flushing | |
0:00:05.293711344 8185 0x1545090 DEBUG v4l2src v4l2src_calls.c:191:gst_v4l2src_grab_frame: stop called | |
0:00:05.293737276 8185 0x1545090 DEBUG basesrc gstbasesrc.c:2232:gst_base_src_get_range:<v4l2src0> create returned -2 (wrong-state) | |
0:00:05.293754932 8185 0x1545090 INFO basesrc gstbasesrc.c:2405:gst_base_src_loop:<v4l2src0> pausing after gst_base_src_get_range() = wrong-state | |
0:00:05.293777495 8185 0x1545090 DEBUG basesrc gstbasesrc.c:2545:gst_base_src_loop:<v4l2src0> pausing task, reason wrong-state | |
0:00:05.293807345 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Module Room | |
define([ | |
"namespace", | |
"use!backbone" | |
], | |
function(namespace, Backbone) { | |
var Room = namespace.module(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
"namespace", | |
"use!backbone", | |
"modules/message", | |
"text!templates/room_tpl.html", | |
"text!templates/room_row_tpl.html" | |
], | |
function(namespace, Backbone, Message, room_tpl, room_row_tpl) { | |
var Room = namespace.module(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var name_is_unique = false; | |
var name; | |
while (!name_is_unique) { | |
name = namer.generate(); | |
var waiting_on_db = true; | |
User.find({name: name}, function(err,docs) { | |
if (docs.count > 0) { | |
name_is_unique = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set up Mongoose | |
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
var ObjectId = Schema.ObjectId; | |
var UserSchema = new Schema({ | |
id: ObjectId, | |
name: String, | |
registered: {type: Boolean, default: false}, | |
password_hash: {type: String, default: ""}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Router = Backbone.Router.extend({ | |
routes: { | |
"": "index", | |
"profiles": "profiles", | |
"profiles/:id": "index" | |
}, | |
index: function() { | |
var home = new Home.Model({con_name: "Bureaucracon"}); | |
var home_view = new Home.Views.Main({model: home}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ============================================================================ | |
// TASKS | |
// ============================================================================ | |
task.registerTask("server", "Run development server.", function(prop) { | |
var props = ["server"]; | |
// If a prop was passed as the argument, use that sub-property of server. | |
if (prop) { props.push(prop); } | |
var options = config(props) || {}; |
OlderNewer