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

Simple validations don't work #20

Open morgz opened 13 years ago

morgz commented 13 years ago

class Product < ActiveRecord::Base acts_as_citier validates :name, :uniqueness => true

class Dictionary < Book acts_as_citier

Product.create!(:name -> 'a book') Dictionary.create!(:name => 'a book')

ActiveRecord::StatementInvalid: Mysql2::Error: Unknown column 'view_dictionaries.name' in 'where clause': SELECT 1 FROM products WHERE (view_dictionaries.name = BINARY 'a book') LIMIT 1

morgz commented 13 years ago

This seems to only be for :uniqueness => true

I've written a custom validator called citier_uniqueness in my fork

voltechs commented 12 years ago

I'm not exactly sure how the whole "pull/push/fork" stuff works (I come from the SVN world) but, can you merge your stuff with the main project to help it out and keep everything in one place?