Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

`db': No database associated with Sequel::Model (Sequel::Error) #1

@EppO

Description

@EppO

When I use a Sinatra::Base class to create my App like for example:
myapp.rb

require 'sinatra/base'
require 'sinatra/sequel'

class MyApp < Sinatra::Base

   configure do
     set :sessions, true
     set :database, "postgres://username:password@localhost/mydb"
     require 'article.rb'
   end

   get '/' do
      'Hello world!'
   end
end

article.rb
class Article < Sequel::Model
end

wherever I put the require line of my model, this error occurs: 'db': No database associated with Sequel::Model (Sequel::Error)
My goal is to use this model not only in MyApp class but also in another classes instantiated in place of the "hello world" line (so in a get path block).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions