Permalink
Browse files

Make the path absolute when the file is not found (sqlite3).

  • Loading branch information...
1 parent 0684fb5 commit 328fc5536b4d1e1724ed8375b4b450810e1a2f81 @david david committed Apr 10, 2008
Showing with 11 additions and 6 deletions.
  1. +11 −6 lib/data_mapper/adapters/sqlite3_adapter.rb
@@ -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

0 comments on commit 328fc55

Please sign in to comment.