Skip to content

Is it possible to use "use_database" when not authorized to create new databases? #197

Description

@niuage

My model:

class Team < CouchRest::Model::Base
  use_database "teams"
end

use_database calls prepare_database, which calls self.server.database!(db).
I'm using the Cloudant service, and I'm authenticating with an api key + password. This key only has rights on an existing database, it can't create new ones. So self.server.database!(db) fails, even though the db already exists.

How can I get around that? Overriding Team.database seems to work, but I'd rather not have to do that.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions