I guess I'm asking for trouble, but I have a table where the primary
key column is :key
Advice wanted on this.

this works
    DB[:dict].insert(
      :key => 'A',
      :value => '1',
      :creation_time => now,
      :modification_time => now )

Given this Model subclass
    class DictRow < Sequel::Model
    end

this works
dictRow.create do |r|
  r.key = 'Z'
  r.value = 99
end

this fails
dictRow.create(:key => 'Y', :value => '98', :creation_time =>
now, :modification_time => now)

/home/craig/.rvm/gems/ruby-1.9.2...@sequel_ex_001/gems/sequel-3.17.0/
lib/sequel/model/base.rb:1339:in `block in set_restricted': method
key= doesn't exist or access is restricted to it (Sequel::Error)
        from /home/craig/.rvm/gems/ruby-1.9.2...@sequel_ex_001/gems/
sequel-3.17.0/lib/sequel/model/base.rb:1334:in `each'
        from /home/craig/.rvm/gems/ruby-1.9.2...@sequel_ex_001/gems/
sequel-3.17.0/lib/sequel/model/base.rb:1334:in `set_restricted'
        from /home/craig/.rvm/gems/ruby-1.9.2...@sequel_ex_001/gems/
sequel-3.17.0/lib/sequel/model/base.rb:1015:in `set'
        from /home/craig/.rvm/gems/ruby-1.9.2...@sequel_ex_001/gems/
sequel-3.17.0/lib/sequel/model/base.rb:704:in `initialize'
        from /home/craig/.rvm/gems/ruby-1.9.2...@sequel_ex_001/gems/
sequel-3.17.0/lib/sequel/model/base.rb:128:in `new'
        from /home/craig/.rvm/gems/ruby-1.9.2...@sequel_ex_001/gems/
sequel-3.17.0/lib/sequel/model/base.rb:128:in `create'
        from ex001.rb:40:in `<main>'

-- 
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