Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting connection.port inside a model class is ignored #189

Open
mpapper opened this issue Aug 16, 2014 · 0 comments
Open

Setting connection.port inside a model class is ignored #189

mpapper opened this issue Aug 16, 2014 · 0 comments

Comments

@mpapper
Copy link

mpapper commented Aug 16, 2014

If I set the defaults for the couchdb database protocol, host, port etc using either a config/couchdb.yml file OR by calling CouchRest::Model::Base.configure do |config| ... these settings are not override-able even if specified explicitly in a model.

To illustrate:
put this in the config/couchdb.yml:

development:
protocol: http
host: localhost
port: 5984

Then make the following call in the rails console:

class ProjectG < CouchRest::Model::Base
use_database 'atlas'
connection.update(:host => 'app20068047.heroku.cloudant.com', :port => '443', :username=>'onedisceakeyreaturstreas', :password=>'XXXXX', :prefix=>nil,:suffix=>nil,:protocol=>'https')
end
ProjectG.database # => an error related to the call using the host/port/protocol set in the couchdb.yml

BUT if I move the coucgdb.yml out of config and restart my console and type the above class definition for ProjectG I get:

=> https://onedisceakeyreaturstreas:XXXXX@app20068047.heroku.cloudant.com:443/atlas

The error/fault is that the settings in couchdb.yml are never overrideable by any model class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant