Hi Colin,

Thanks for asking that question.  I had preloaded the database so I 
didn't have to create a new record.  So now I just tried doing that and 
it wouldn't let me create a new record although the :aspect value I used 
does not exist at all in the database.  Console output is below:

>> stat0 = Stat.new(:user => user0, :aspect => "aspect0")
=> #<Stat id: nil, user_id: 1000, aspect: "aspect0", . . .>
>> stat0.save!
ActiveRecord::RecordInvalid: Validation failed: Aspect has already been 
taken
  from 
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/validations.rb:1021:in
 
`save_without_dirty!'
  from 
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/dirty.rb:87:in
 
`save_without_transactions!'
  from 
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:200:in
 
`save!'
  from 
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in
 
`transaction'
  from 
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:182:in
 
`transaction'
  from 
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:200:in
 
`save!'
  from 
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:208:in
 
`rollback_active_record_state!'
  from 
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:200:in
 
`save!'
  from (irb):70

"aspect0" is something I completely made up and does not exist in the 
database.  :user_id 1000 does exist in different rows with different 
values of :aspect however.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to