You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code that uses a unique + scope validation (to validate uniqueness for a two column combo) is broken with CPK. Instead of getting "has already been taken", I'm getting "translation missing: en, activerecord, errors, models, location, attributes, siteid, taken".
require 'composite_primary_keys'
require 'active_record'
class Location < ActiveRecord::Base
validates :siteid,
:length => {:is => 6},
:uniqueness => {:scope => :schoolid},
:presence => true
end
location = Location.new
location.schoolid = 'SOMEXX'
location.siteid = 'ATM-01'
p location.valid?
p location.errors
The text was updated successfully, but these errors were encountered:
Rails 3.0.3
CPK 3.0.7
PostgreSQL 8.x
The following code that uses a unique + scope validation (to validate uniqueness for a two column combo) is broken with CPK. Instead of getting "has already been taken", I'm getting "translation missing: en, activerecord, errors, models, location, attributes, siteid, taken".
The text was updated successfully, but these errors were encountered: