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
class Post | |
include DataMapper::Resource | |
property :id, Serial | |
property :title, String | |
property :content, Text | |
property :created_at, DateTime | |
property :updated_at, DateTime | |
validates_length :title, :min => 5 |
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
require "rubygems" | |
require "sinatra" | |
require "dm-core" | |
require "dm-timestamps" | |
require "dm-aggregates" | |
require "syntaxi" | |
require "bb-ruby" | |
@db_info = { | |
:host => 'localhost', |
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
// Common JavaScript code across your application goes here. | |
jQuery.ajaxSetup({ | |
'beforeSend': function(xhr) { xhr.setRequestHeader("Accept", "text/javascript") } | |
}) | |
$(document).ready(fuction() { | |
$("a.vote_up").click(function(){ | |
$.post($this, { 'vote[]': "1" }); | |
}) | |
}) |
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
$(document).ready(function() { | |
$("div.votes a").click(function() { | |
$.post( this.href, {"vote[vote]": (this.className == "vote_up") ? 1 : -1} ); | |
$(this).parent().children("a").hide(); | |
$(this).parent().html("<img src=\"/images/accept.png\" />Voted"); | |
var count = intParse($(this).parent().parent().children("div.count").text()); | |
$(this).parent().parent().children("div.count").text((count+1)); | |
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
class Message | |
belongs_to :author, :class_name => 'User' | |
has 1, :subject # (polymorphic) | |
end |
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
gems/dm-core-0.9.9/lib/dm-core/model.rb:478:in `method_missing': Unknown property 'delegate' (ArgumentError) | |
from /Users/justinsmestad/Documents/Factory/smoke_hut/app/models/resort.rb:11 | |
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
~ Reaping Workers | |
merb : cold_express : worker (port 4000) ~ Worker Thread Crashed with Exception: | |
- (RuntimeError) | |
/usr/lib/ruby/gems/1.8/gems/merb-core-1.0.7.1/lib/merb-core/dispatch/worker.rb:17:in `process_queue' | |
/usr/lib/ruby/gems/1.8/gems/merb-core-1.0.7.1/lib/merb-core/dispatch/worker.rb:32:in `initialize' | |
/usr/lib/ruby/gems/1.8/gems/merb-core-1.0.7.1/lib/merb-core/dispatch/worker.rb:31:in `loop' | |
/usr/lib/ruby/gems/1.8/gems/merb-core-1.0.7.1/lib/merb-core/dispatch/worker.rb:31:in `initialize' | |
/usr/lib/ruby/gems/1.8/gems/merb-core-1.0.7.1/lib/merb-core/dispatch/worker.rb:30:in `new' | |
/usr/lib/ruby/gems/1.8/gems/merb-core-1.0.7.1/lib/merb-core/dispatch/worker.rb:30:in `initialize' | |
/usr/lib/ruby/gems/1.8/gems/merb-core-1.0.7.1/lib/merb-core/dispatch/worker.rb:13:in `new' |
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
check process merb_cold_master | |
with pidfile /var/log/engineyard/cold/cold-production-merb.main.pid | |
start program = "/engineyard/bin/monit_merb_mpc cold start_master -c2 -n4000 -e express" | |
stop program = "/engineyard/bin/monit_merb_mpc cold stop_master" | |
#if totalmem is greater than 80.0 MB for 2 cycles then restart # eating up memory? | |
group merb_cold | |
# Worker configuration (one for each worker port required) | |
check process merb_cold_4000 | |
with pidfile /var/log/engineyard/cold/cold-production-merb.4000.pid |
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
def index | |
@user = User.all('user.shortcode'.not => nil) | |
display @user | |
end |
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
Given /^I am logged in as "(.+)"$/ do |user| | |
Given "a user exists with login \"#{user}\" and password \"thedude\"" | |
Given "I go to /login" | |
Given "I fill in \"login\" with \"#{user}\"" | |
Given "I fill in \"password\" with \"thedude\"" | |
Given "I press \"Login\"" | |
end | |
Scenario Outline: Shortcode Generated |
OlderNewer