petehamilton / citier

CITIER (Class Inheritance & Table Inheritance Embeddings for Rails) is a solution for simple Multiple Class Inheritance in Rails.
88 stars 24 forks source link

Issue creating from child class #24

Closed kylefleming closed 13 years ago

kylefleming commented 13 years ago

I have a very simple multiple-table inheritance setup with a Song and a Media class. Song inherits from Media.

However, when I try to do Song.create! it gives me the following error: ERROR: null value in column "id" violates not-null constraint

I debugged it down to citier telling media to create with a NULL id, which postgres doesn't seem to like. It (postgres) requires the id field to be left out.

I've created a very simple fix: https://github.com/Rexly/citier/commit/5db02535f5f9ff16248736d617358aaa8bc11dd7

kylefleming commented 13 years ago

(double posted through pull request)