Skip to content

Commit

Permalink
Make the path absolute when the file is not found (sqlite3).
Browse files Browse the repository at this point in the history
  • Loading branch information
david committed Apr 10, 2008
1 parent 0684fb5 commit 328fc55
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions lib/data_mapper/adapters/sqlite3_adapter.rb
Expand Up @@ -7,19 +7,24 @@ module Adapters
class Sqlite3Adapter < DataObjectsAdapter

TYPES.merge!({
:integer => 'INTEGER'.freeze,
:string => 'TEXT'.freeze,
:text => 'TEXT'.freeze,
:class => 'TEXT'.freeze,
:boolean => 'INTEGER'.freeze
})
:integer => 'INTEGER'.freeze,
:string => 'TEXT'.freeze,
:text => 'TEXT'.freeze,
:class => 'TEXT'.freeze,
:boolean => 'INTEGER'.freeze
})

def create_connection
connnection = DataObjects::Sqlite3::Connection.new(@uri)
# connnection.logger = DataMapper.logger
return connnection
end

def uri(uri_or_options)
uri = super(uri_or_options)
uri.path = File.join(Dir.pwd, File.dirname(uri.path), File.basename(uri.path)) unless File.exists?(uri.path)
uri
end
end # class Sqlite3Adapter

end # module Adapters
Expand Down

0 comments on commit 328fc55

Please sign in to comment.