Closed alexmingoia closed 10 years ago
Thanks for this.
How are the field names normally generated? If JugglingDB'd make usage of Underscore.String, it could make use of the _s.underscored("emailAddress") == "email_address"
function.
I'd see this feature to override the default behaviour when using "weird" schemas, or normalizing models.
My 2 cents.
I think it's have buggy behaviour on create/update databases.
Just look at this: https://gist.github.com/zxqfox/19662d3ec545a149924c
testing with postgres adapter.
Guys. How to write tests for adapters? What should be placed in jugglingdb
? Atm I didn't see any tests in jugglingdb/postgres
adapter
This closes #119 by adding support for storing data using a field name defined by the schema.
For example, to store
emailAddress
asemail_address
, you use thename
parameter:I've added a test for it and updated documentation: https://github.com/alexmingoia/jugglingdb/blob/custom-fieldnames/docs/schema.md#custom-database-columnfield-names