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
# For a sailing club - so they can define their own booking types.... | |
# model: booking_type.rb | |
class BookingType | |
include DataMapper::Resource | |
# properties | |
property :id, Integer, :serial => true | |
property :name, String, :nullable => false | |
property :name_permalink, String # pluralized 'permalinked' version of name |
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
# ********************************************************************** | |
# *** with load_classes_with_requirements as per current merb source *** | |
# ********************************************************************** | |
# -------------------------------------------------------------------------------------------- | |
# The datamapper models I've been having probs with | |
# admin_entered_new_membership.rb | |
puts "loading AdminEnteredNewMembership" | |
class AdminEnteredNewMembership < MembershipApplication |
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
# *************************************************** | |
# *** with load_classes_with_requirements patched *** | |
# *************************************************** | |
# -------------------------------------------------------------------------------------------- | |
# The datamapper models I've been having probs with | |
# admin_entered_new_membership.rb | |
puts "loading AdminEnteredNewMembership" | |
class AdminEnteredNewMembership < MembershipApplication |
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 DataMapper | |
module Is | |
module StateMachine | |
# hook may be either a Proc or symbol | |
def run_hook_if_present(hook) | |
return true unless hook | |
if hook.respond_to?(:call) | |
hook.call(self) | |
else |
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
From 42c65f3201d294613d0549bf8312f4b01e91ae00 Mon Sep 17 00:00:00 2001 | |
From: Rupert Voelcker <rupert@rupespad.com> | |
Date: Mon, 13 Apr 2009 16:22:02 +0100 | |
Subject: [PATCH] fix for more complex has many through | |
--- | |
.../nested_attributes.rb | 2 +- | |
spec/fixtures/photo.rb | 9 + | |
spec/fixtures/tag.rb | 12 ++ | |
spec/fixtures/tagging.rb | 10 + |
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 Merb | |
class MailController | |
def dispatch_and_deliver(method, mail_params) | |
non_array = mail_params.dup.delete_if { |k,v| v.is_a?(Array) } | |
array = mail_params.dup.delete_if { |k,v| !v.is_a?(Array) } | |
@mailer = self.class._mailer_klass.new(non_array) | |
@mail = @mailer.mail | |
@method = method |
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 'dm-core' | |
class User | |
include DataMapper::Resource | |
property :id, Serial | |
end | |
class Paper |
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
Rake.application.instance_variable_get('@tasks').delete('spec:rcov') | |
module SimpleCov | |
class RakeTask < ::Rake::TaskLib | |
def initialize(*args) | |
desc "Run RSpec code examples" | |
task(args.shift || :simplecov) do | |
RakeFileUtils.send(:verbose, true) do | |
if files_to_run.empty? |
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
86 specs, 3 failures in 0.628sFinished at Thu Sep 08 2011 07:44:01 GMT+0100 (BST) | |
runStoryCollection collection | |
runposition | |
runshould return stories in position order | |
runshould move between 2 other stories | |
runshould move after another story | |
runshould move after the last story | |
runshould move before the first story | |
runshould move before another story | |
runshould return the story after a given story |
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 _user$project$Native_CanvasTexture = function() { | |
function higherPow2(aSize){ | |
return Math.pow(2, Math.ceil(Math.log(aSize) / Math.log(2))); | |
} | |
function makeTextCanvas(context, text, fontSize, width, height) { | |
context.canvas.width = width; | |
context.canvas.height = height; | |
context.clearRect(0, 0, context.canvas.width, context.canvas.height); |
OlderNewer