Skip to content

Instantly share code, notes, and snippets.

View snusnu's full-sized avatar

Martin Gamsjaeger snusnu

View GitHub Profile
module DataMapper
module Types
class UtcDateTime < DataMapper::Type
primitive DateTime
def self.load(value, property)
if value.nil?
nil
snusnu
guys, is this a known bug in current master? http://pastie.org/810422 … imho railties shouldn't depend on mysql gem (datamapper for one doesn't need that)
is this bundler related?
_nb_
that is a known bug .. we ran into it earlier today
i think those gems (pg, mysql, etc) are defined to be development requirements
but rake gem isn't respecting that
_nb_
source 'http://gemcutter.org'
gem 'rails', '3.0.0.beta'
gem 'data_objects', '0.10.1'
gem 'do_mysql', '0.10.1'
git 'git://github.com/snusnu/dm-core.git', 'branch' => 'active_support'
git "git://github.com/snusnu/dm-more.git", 'branch' => 'active_support'
git 'git://github.com/dkubb/rails3_datamapper.git'
source 'http://gemcutter.org'
gem 'data_objects', '0.10.1'
gem 'do_mysql', '0.10.1'
git 'git://github.com/rails/rails.git'
gem 'rails', '3.0.0.beta'
git 'git://github.com/snusnu/dm-core.git', 'branch' => 'active_support'
#----------------------------------------------------------------------------
# Git Setup
#----------------------------------------------------------------------------
file '.gitignore', <<-FILE
.DS_Store
log/*.log
tmp/**/*
config/database.yml
db/*.sqlite3
public/uploads/*
# -----------------------------------------------------------------------------
# thor actions
# -----------------------------------------------------------------------------
# Copies recursively the files from source directory to root directory.
# If any of the files finishes with .tt, it's considered to be a template
# and is placed in the destination without the extension .tt. If any
# empty directory is found, it's copied and all .empty_directory files are
# ignored. Remember that file paths can also be encoded, let's suppose a doc
## in a railtie initializer
initializer 'data_mapper.configuration' do |app|
app.config.data_mapper = Rails::DataMapper::Configuration.for(
app.config.database_configuration
)
puts app.config.data_mapper.inspect
puts app.config.data_mapper.class
end
## running
gsub_file 'config/application.rb', /require 'rails\/all'/ do
<<-RUBY
# Pick the frameworks you want:
require 'action_controller/railtie'
require 'rails3_datamapper/railtie'
require 'action_mailer/railtie'
# require 'active_resource/railtie'
# require 'rails/test_unit/railtie'
RUBY
end
def with_dm_logger(level = :debug)
DataObjects::Mysql.logger.level = level
yield
ensure
DataObjects::Mysql.logger.level = :off
end
module ParameterSanitization
def self.included(host)
host.extend(ClassMethods)
host.send(:include, InstanceMethods)
end
module ClassMethods
attr_reader :resource, :properties_to_sanitize
def sanitize_resource_params(resource, *properties)