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 Types | |
class UtcDateTime < DataMapper::Type | |
primitive DateTime | |
def self.load(value, property) | |
if value.nil? | |
nil |
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
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_ |
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
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' |
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
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' |
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
#---------------------------------------------------------------------------- | |
# Git Setup | |
#---------------------------------------------------------------------------- | |
file '.gitignore', <<-FILE | |
.DS_Store | |
log/*.log | |
tmp/**/* | |
config/database.yml | |
db/*.sqlite3 | |
public/uploads/* |
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
# ----------------------------------------------------------------------------- | |
# 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 |
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
## 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 |
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
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 |
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 with_dm_logger(level = :debug) | |
DataObjects::Mysql.logger.level = level | |
yield | |
ensure | |
DataObjects::Mysql.logger.level = :off | |
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
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) |