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
# This is an incomplete implementation. | |
module MongoMapper | |
module NestedAttributes | |
def self.included(base) | |
base.extend(ClassMethods) | |
base.send :include, InstanceMethods | |
end | |
module ClassMethods | |
def accepts_nested_attributes_for(*attr_names) |
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 Paperclip | |
class << self | |
def logger #:nodoc: | |
MongoMapper.logger | |
end | |
end | |
module ClassMethods | |
def has_attached_file name, options = {} | |
include InstanceMethods |
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
/usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.2/lib/bundler/source.rb:552:in `load_spec_files': git://github.com/bhbryant/aasm.git (at master) is not checked out. Please run `bundle install` (Bundler::PathError) | |
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.2/lib/bundler/source.rb:371:in `local_specs' | |
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.2/lib/bundler/source.rb:534:in `specs' | |
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.2/lib/bundler/lazy_specification.rb:48:in `__materialize__' | |
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.2/lib/bundler/spec_set.rb:83:in `materialize' | |
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.2/lib/bundler/spec_set.rb:81:in `map!' | |
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.2/lib/bundler/spec_set.rb:81:in `materialize' | |
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.2/lib/bundler/definition.rb:93:in `specs' | |
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0.r |
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
replica_sets = mm_env['replica_sets'] # node1:port&node2:port | |
rs_list = replica_sets.split("&").map {|rs| host,port = rs.split(":"); [host,port.to_i] } | |
MongoMapper.connection = Mongo::RetryReplicaSetConnection.new(*(rs_list << {:read_secondary => true, :auto_refresh => true })) | |
MongoMapper.database = mm_env['database'] | |
MongoMapper.database.authenticate(mm_env['username'], mm_env['password']) |