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

using several stores / overrides - merges not as expected #15

Closed
jondot opened this issue Nov 16, 2011 · 10 comments
Closed

using several stores / overrides - merges not as expected #15

jondot opened this issue Nov 16, 2011 · 10 comments

Comments

@jondot
Copy link

jondot commented Nov 16, 2011

Hi,
I'm trying to set up store as such:

conf.add 'user',   { type: 'file', file: 'config/config.local.json' }
conf.add 'global', { type: 'file', file: 'config/config.json' }

I then expect the user values to override the global values such that:

# user
{ port:4000}

# global
{ port:80}

but in every case i'm getting port:80 being resloved.
if i reverse the order like so:

conf.add 'global', { type: 'file', file: 'config/config.json' }
conf.add 'user',   { type: 'file', file: 'config/config.local.json' }

then i get undefined values, because global declares more values than in user.

# global
{ port:80, db:"host"}

# user
{ port:4000}

db is undefined -- seems to be overriden in user - but i'm not specifying it there in any case and expecting it to be merged from global.

anything i'm doing wrong here?

Thanks!

@mmalecki
Copy link
Contributor

Does #13 work as you'd expect it?

@jondot
Copy link
Author

jondot commented Nov 16, 2011

going over #13's diff, i don't see any changes to merge logic, so i'm not sure. i guess i'll have to use the commiter's branch and try it.
in general i'm surprised by 'undefined' values overriding defined values.

@dominictarr
Copy link
Contributor

@jondot hmm, that is how I would expect this to work as well. that is certainly the impression that I get from the usage of "hierarchical" in the README

@jfhbrook
Copy link
Contributor

Here's another example:

https://gist.github.com/1387428

@jondot
Copy link
Author

jondot commented Nov 23, 2011

so in that case the movie param is undefined. is this intended?

@jfhbrook
Copy link
Contributor

@jondot No.

@indexzero
Copy link
Owner

I'm investigating this. It will be fixed in the 0.5.x branch.

@indexzero
Copy link
Owner

This is confirmed fixed in the 0.5.x branch which I hope to have out by the end of the day.

@indexzero
Copy link
Owner

The tests which confirm this are the gist from @jesusabdullah verbatim with some vows and assertions in 38fcbc7

@indexzero
Copy link
Owner

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

No branches or pull requests

5 participants