gadelkareem / sails-dynamodb

Amazon DynamoDB adapter for Waterline / Sails.js
http://sailsjs.org
46 stars 22 forks source link

Unwanted table pluralization #4

Closed jesdynf closed 9 years ago

jesdynf commented 9 years ago

Even when I specify an explicit tableName key in my model exports, sails-dynamodb (or vogels) appears to be pluralizing my table names prior to access attempts.

Specifically, setting tableName: 'issues' in a model and and then browsing that blueprint route causes the following error:

Details: AccessDeniedException: User: arn:aws:iam::[redacted_id]:user/[redacted_user] is not authorized to perform: dynamodb:Scan on resource: arn:aws:dynamodb:us-ea st-1:[redacted id]:table/issuess

I tried removing the " + 's'" from index.js:364 but that didn't solve the issue.

devinivy commented 9 years ago

Hi! The issue is that Vogels forces pluralization of table name for some bizarre reason, and this adapter relies on Vogels. I currently have a PR (#3) going through that will fix this for you.

jesdynf commented 9 years ago

I pulled that in and it solved the problem handily. Thanks a lot -- hopefully this'll go live soon!