velocious 1.0.80 → 1.0.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "velocious": "bin/velocious.js"
4
4
  },
5
5
  "name": "velocious",
6
- "version": "1.0.80",
6
+ "version": "1.0.81",
7
7
  "main": "index.js",
8
8
  "scripts": {
9
9
  "test": "VELOCIOUS_TEST_DIR=../ cd spec/dummy && npx velocious test",
@@ -1029,6 +1029,10 @@ class VelociousDatabaseRecord {
1029
1029
  }
1030
1030
 
1031
1031
  id() {
1032
+ if (!this.constructor._columnNameToAttributeName) {
1033
+ throw new Error(`Column names mapping hasn't been set on ${this.constructor.name}. Has the model been initialized?`)
1034
+ }
1035
+
1032
1036
  const primaryKey = this.constructor.primaryKey()
1033
1037
  const attributeName = this.constructor._columnNameToAttributeName[primaryKey]
1034
1038