end
def connect
- # @conn = PGconn.connect('localhost', 5432, '', '', 'quanlib', 'quanlib', 'quanlib')
- # @conn = PG.connect(@dbhost, @dbport, '', '', @dbname, @dbuser, @dbpass)
@conn = TimedConn.new(PG.connect(@dbhost, @dbport, '', '', @dbname, @dbuser, @dbpass))
return @conn
end
end
def find_classification(author_grouping, title_grouping)
- #puts 'find_classification("' + author_grouping.inspect + '", "' + title_grouping.inspect + '")...'
sql = "SELECT id FROM Classifications WHERE author_grouping = $1 AND title_grouping = $2;"
@conn.exec_params(sql, [author_grouping, title_grouping]) do |rs|
if rs.ntuples > 0
- #puts ' --> ' + rs[0]['id'].inspect
return rs[0]['id']
end
end
- #puts ' --> NIL'
return nil
end
fullpath = @basePath + '/efs/' + efspath + '/' + efsname
return Cover.new(nil, fullpath, mime_type)
-
- #File.open(fullpath, 'rb') do |is|
- # return Cover.new(is, fullpath, mime_type)
- #end
- #
- #return nil
end
def store_cover(book)