This file contains hidden or 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
source 'http://rubygems.org' | |
RAILS_VERSION = '~> 3.0.0.beta4' | |
DM_VERSION = '~> 1.0.0' | |
RSPEC_VERSION = '~> 2.0.0.beta.13' | |
gem 'activesupport', RAILS_VERSION, :require => 'active_support' | |
gem 'actionpack', RAILS_VERSION, :require => 'action_pack' | |
gem 'actionmailer', RAILS_VERSION, :require => 'action_mailer' | |
gem 'railties', RAILS_VERSION, :require => 'rails' |
This file contains hidden or 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 PersistentIdentityMap | |
def self.included(base) | |
base.extend(ResourceClassMethods) | |
end | |
def _dump(depth) | |
marshaled_properties = properties.inject({}) do |h, p| | |
h[p.instance_variable_name] = p.get!(self) | |
h | |
end |
This file contains hidden or 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 "moneta" | |
require 'moneta/redis' | |
module DataMapper | |
# Tracks objects to help ensure that each object gets loaded only once. | |
# See: http://www.martinfowler.com/eaaCatalog/identityMap.html | |
class IdentityMap < Moneta::Redis | |
extend Deprecate |
This file contains hidden or 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
diff --git a/dm-validations/lib/dm-validations/validators/uniqueness_validator.rb b/dm-validations/lib/dm-validations/validators/uniquen | |
index 16fc786..6bec021 100644 | |
--- a/dm-validations/lib/dm-validations/validators/uniqueness_validator.rb | |
+++ b/dm-validations/lib/dm-validations/validators/uniqueness_validator.rb | |
@@ -22,8 +22,11 @@ module DataMapper | |
repository_name = target.repository.name | |
+ fields = target.model.key.dup | |
+ fields << target.model.properties[field_name] |
This file contains hidden or 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
user system total real | |
Create 1000 posts with DM and Redis 0.390000 0.130000 0.520000 ( 0.798371) | |
Create 1000 posts with DM and Postgres 0.430000 0.060000 0.490000 ( 1.276239) | |
Create 1000 posts with RedisClient 0.190000 0.150000 0.340000 ( 0.555850) | |
user system total real | |
Fetch the 500th post with DM and Redis 0.000000 0.000000 0.000000 ( 0.003334) | |
Fetch the 500th post's text with DM and Postgres 0.000000 0.000000 0.000000 ( 0.002007) | |
Fetch the 500th post's text with RedisClient 0.000000 0.000000 0.000000 ( 0.000456) |
This file contains hidden or 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 records_for(query) | |
set = @redis.set_members("#{query.model}:#{redis_key_for(query.model)}:all") | |
arr = Array.new(set.size) | |
set.each_with_index do |val, i| | |
arr[i] = {"#{redis_key_for(query.model)}" => val.to_i} | |
end | |
arr | |
end |
This file contains hidden or 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 e9aea3f6b29b2803221dbfacdb239a9f1599b2d5 Mon Sep 17 00:00:00 2001 | |
From: Whoahbot <whoahbot@gmail.com> | |
Date: Tue, 5 May 2009 15:56:40 -0700 | |
Subject: [PATCH] Adding in translations for before_type_cast, fixes a bug with rails formbuilder | |
--- | |
lib/globalize/model/active_record.rb | 4 +++- | |
test/model/active_record/translated_test.rb | 5 +++++ | |
2 files changed, 8 insertions(+), 1 deletions(-) |
This file contains hidden or 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
function sendMsg(message) { | |
try { | |
var aMsg = new JSJaCMessage(); | |
aMsg.setTo(new JSJaCJID("#wewo@conference.example.com/whoahbot")); | |
aMsg.setType('groupchat'); | |
aMsg.setBody(message); | |
con.send(aMsg); | |
} catch (e) { | |
$('#chat').html("<div class='msg error''>Error: "+ e.message +"</div>"); | |
} |
This file contains hidden or 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
function doLogin(form) { | |
$('#log').html(''); | |
try { | |
oArgs = new Object(); | |
oArgs.httpbase = 'http://whoahbot.example.com/http-bind/'; | |
oArgs.timerval = 2000; | |
con = new JSJaCHttpBindingConnection(oArgs); |