JackAdams / meteor-transactions

App level transactions for Meteor + Mongo
http://transactions.taonova.com/
MIT License
113 stars 16 forks source link

Conflict when the app already contains a `Transactions` collection #36

Closed plbrault closed 8 years ago

plbrault commented 9 years ago

When an app already defines a MongoDB collection named transactions, the developers are forced to change its name after installing the package. I think that the collection created by the package should be renamed to something that is not a plain dictionary word to avoid any conflict.

JackAdams commented 9 years ago

Good point. There might be some backwards compatibility concerns doing this, but you're right - the collection name should be prefixed with an underscore at least.

Sent from my iPhone

On Aug 24, 2015, at 11:25 PM, Pier-Luc Brault notifications@github.com wrote:

When an app already contains a collection named Transactions, the developers are forced to change its name before installing the package. I think that the collection created by the package should be renamed to something that is not a plain dictionary word to avoid any conflict.

— Reply to this email directly or view it on GitHub.

ericoe commented 9 years ago

How about a config setting to chg name?

stivaugoin commented 9 years ago

Good idea @ericoe

JackAdams commented 9 years ago

Agreed. Will make this option available in the next release.

Sent from my iPhone

On Aug 25, 2015, at 9:34 PM, Steve Bourgoin notifications@github.com wrote:

Good idea @ericoe

— Reply to this email directly or view it on GitHub.

JackAdams commented 8 years ago

In 0.7.5, the transactions collection can be specified in a settings.json file in the project root:

{
  transactionsCollection: "transactionRecords"
}
stivaugoin commented 8 years ago

Thanks!

saliksaly commented 8 years ago

Does not work. Client still shows error: "ncaught Error: There is already a collection named "transactions". I think it's because the settings in settings.json is not accessible from client (it it is not in the "public" area).

JackAdams commented 8 years ago

Yes, I believe you're right. I'll accept a PR and republish if there's a solution for this.

On another note, if you're using this package to deal with money type transactions, I'd have to warn against it. Using this package is a step up from no db transactions, but it's not mature enough to have important data relying on its functionality.

I use it in a couple of production apps and, although it hasn't let me down, I know that it's no big deal if it ever does.

saliksaly commented 8 years ago

Thank you Yes, I've read your warning about using it in money treating apps. I want it for simpe purpose, for my own risk.