Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit 328fc5536b4d1e1724ed8375b4b450810e1a2f81 1 parent 0684fb5
@david david authored
Showing with 11 additions and 6 deletions.
  1. +11 −6 lib/data_mapper/adapters/sqlite3_adapter.rb
View
17 lib/data_mapper/adapters/sqlite3_adapter.rb
@@ -7,12 +7,12 @@ 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)
@@ -20,6 +20,11 @@ def create_connection
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.
Something went wrong with that request. Please try again.