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
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 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
# *************************************************** | |
# *** 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
# ********************************************************************** | |
# *** 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
# 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 |
NewerOlder