Hi, Thanks for the reply. I should have been clearer Model and A are two different classes. Come to think of it...looks like it might not be easily doable.
---- Regards, Akhil Kodali Marie von Ebner-Eschenbach<http://www.brainyquote.com/quotes/authors/m/marie_von_ebnereschenbac.html> - "Even a stopped clock is right twice a day." On Tue, Feb 23, 2010 at 10:36 PM, rohit <[email protected]> wrote: > Not sure I understand the question. Does this help? > > $ sequel sqlite://test.db > Your database is stored in DB... > irb(main):001:0> DB.create_table :a do > irb(main):002:1* primary_key :id > irb(main):003:1> column :type, :string > irb(main):004:1> column :name, :string > irb(main):005:1> end > => [] > irb(main):006:0> class A < Sequel::Model(:a); end > => nil > irb(main):007:0> A.create(:type => '1', :name => 'first') > => #<A @values={:type=>"1", :name=>"first", :id=>1}> > irb(main):008:0> first = A.first > => #<A @values={:type=>"1", :name=>"first", :id=>1}> > irb(main):009:0> first.name = 'second' > => "second" > irb(main):010:0> first.save > => #<A @values={:type=>"1", :name=>"second", :id=>1}> > irb(main):011:0> A.first.name > => "second" > irb(main):012:0> > > On Feb 23, 6:42 am, akhil <[email protected]> wrote: > > Hi, > > > > I have a tables - A (id, type, name) and Model (id) > > > > There a way to access/update the rows in A as attributed of Model > > like Model.type = name > > > > Thank you > > > > Akhil Kodali > > -- > 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]<sequel-talk%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/sequel-talk?hl=en. > > -- 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.
