revel / modules

Officially supported Revel modules
http://revel.github.io/modules/
MIT License
49 stars 46 forks source link

[orm/gorm] Allow configuration of singulartable: #66

Closed almarto closed 6 years ago

almarto commented 6 years ago

I want to resolve #64 with this PR.

notzippy commented 6 years ago

@almarto that looks good, can you update the README file with the new configuration parameter name ?

almarto commented 6 years ago

@notzippy it's already there. I added the new parameter to both files:

notzippy commented 6 years ago

Your right, I was looking for more of an explanation on what singulartable means but even gorms godoc isn't clear on that.

Perhaps if you added something in the doc like the following

singulartable

By default all tables are created based on a struct are pluralized ie a type User struct {} becomes table users in the database, by setting this to true, User's default table name will be user. Note table names set with TableName won't be affected by this setting. You can also change the created table names by setting gorm.DefaultTableNameHandler on AppStartup or func init() see here for more details

almarto commented 6 years ago

Sorry for that @notzippy I didn't explain the attribute because the others aren't explained and I thought it was intended for address the user to the gorm documentation.

EDIT: I pushed the changes with better documentation and I've also squashed the commits. Please let me know if you need anything else before this PR can be merged.

notzippy commented 6 years ago

Thanks looks much better - I am trying to improve the documents with every commit - thanks for your help. I changed the base to development which when merged should be out in the beginning of Febuary