All,

Something possible broken with one_to_one.  I have an older rails project that 
I just updated using bundle and I'm getting this:

Sequel::Error: Record not found
        from 
/Users/gregd/.rvm/gems/ruby-1.9.3-p286@euchre/gems/sequel-3.40.0/lib/sequel/model/base.rb:1534:in
 `_refresh'
        from 
/Users/gregd/.rvm/gems/ruby-1.9.3-p286@euchre/gems/sequel-3.40.0/lib/sequel/model/associations.rb:1509:in
 `_refresh'
        from 
/Users/gregd/.rvm/gems/ruby-1.9.3-p286@euchre/gems/sequel-3.40.0/lib/sequel/model/base.rb:1609:in
 `_save_refresh'
        from 
/Users/gregd/.rvm/gems/ruby-1.9.3-p286@euchre/gems/sequel-3.40.0/lib/sequel/model/base.rb:1596:in
 `_save'
        from 
/Users/gregd/.rvm/gems/ruby-1.9.3-p286@euchre/gems/sequel-3.40.0/lib/sequel/model/base.rb:1233:in
 `block (2 levels) in save'
        from 
/Users/gregd/.rvm/gems/ruby-1.9.3-p286@euchre/gems/sequel-3.40.0/lib/sequel/model/base.rb:1701:in
 `block in checked_transaction'
        from 
/Users/gregd/.rvm/gems/ruby-1.9.3-p286@euchre/gems/sequel-3.40.0/lib/sequel/database/query.rb:323:in
 `_transaction'
        from 
/Users/gregd/.rvm/gems/ruby-1.9.3-p286@euchre/gems/sequel-3.40.0/lib/sequel/database/query.rb:285:in
 `block in transaction'
        from 
/Users/gregd/.rvm/gems/ruby-1.9.3-p286@euchre/gems/sequel-3.40.0/lib/sequel/database/connecting.rb:229:in
 `block in synchronize'
        from 
/Users/gregd/.rvm/gems/ruby-1.9.3-p286@euchre/gems/sequel-3.40.0/lib/sequel/connection_pool/threaded.rb:105:in
 `hold'
        from 
/Users/gregd/.rvm/gems/ruby-1.9.3-p286@euchre/gems/sequel-3.40.0/lib/sequel/database/connecting.rb:229:in
 `synchronize'
        from 
/Users/gregd/.rvm/gems/ruby-1.9.3-p286@euchre/gems/sequel-3.40.0/lib/sequel/database/query.rb:278:in
 `transaction'
        from 
/Users/gregd/.rvm/gems/ruby-1.9.3-p286@euchre/gems/sequel-3.40.0/lib/sequel/model/base.rb:1701:in
 `checked_transaction'
        from 
/Users/gregd/.rvm/gems/ruby-1.9.3-p286@euchre/gems/sequel-3.40.0/lib/sequel/model/base.rb:1233:in
 `block in save'
        from 
/Users/gregd/.rvm/gems/ruby-1.9.3-p286@euchre/gems/sequel-3.40.0/lib/sequel/model/base.rb:1692:in
 `checked_save_failure'
        from 
/Users/gregd/.rvm/gems/ruby-1.9.3-p286@euchre/gems/sequel-3.40.0/lib/sequel/model/base.rb:1233:in
 `save'
        from 
/Users/gregd/.rvm/gems/ruby-1.9.3-p286@euchre/gems/sequel-3.40.0/lib/sequel/model/base.rb:163:in
 `create'
        from (irb):4

        from 
/Users/gregd/.rvm/gems/ruby-1.9.3-p286@euchre/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in
 `start'
        from 
/Users/gregd/.rvm/gems/ruby-1.9.3-p286@euchre/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in
 `start'
        from 
/Users/gregd/.rvm/gems/ruby-1.9.3-p286@euchre/gems/railties-3.2.8/lib/rails/commands.rb:41:in
 `<top (required)>'
        from script/rails:6:in `require'


This occurs when I the code is trying to assign a configuration to a tournament.

class Tournament < Sequel::Model
  one_to_one  :configuration, :class => TournamentConfiguration
end

class TournamentConfiguration < Sequel::Model
  many_to_one :tournament
end

Tournament.first.configuration = TournamentConfiguration.create

It seems I can not create a TournamentConfiguration. I even tried:

TournamentConfiguration.create(:tournament => Tournament.first)

Any help?  Am I doing something wrong?  Is one_to_one not supported anymore and 
should I just use one_to_many for this?

Thanks,

-GregD

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-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/sequel-talk?hl=en.

Reply via email to