[Nitro] Help! undefined method `save'

George Moschovitis george.moschovitis at gmail.com
Wed Mar 23 03:26:30 EST 2005


Create Og::Database after you define your class
or use the ogdb.auto_manage_classes method that will be available
in 0.14.0

-g.


On Fri, 18 Mar 2005 21:43:26 -0700, James Britt
<jamesUNDERBARb at neurogami.com> wrote:
> I'm trying to build an Og app, following the RubyGarden tutorial, and
> when I try to save my object I get this error:
> 
>   undefined method `save'
> 
> #-----------------------------
> #!/usr/bin/env ruby
> require 'og'
> 
>   db = Og::Database.new(
>      :database => 'tag_devel',
>      :adapter  => 'mysql',
>      :user     => 'root',
>      :password => 'password'
>    )
> 
> class Tag
>    prop_accessor :name,      String
>    prop_accessor :context,   String
>    prop_accessor :creator,   String
>    prop_reader :last_update,   Time
> 
>    def initialize(  )
>        yield self if block_given?
>        @last_update = Time.now
>    end
> end
> 
> tag = Tag.new
> 
> tag.name = "Database"
> tag.save
> # undefined method `save' for #<Tag:0x2ec9070> (NoMethodError)
> 
> #-----------------
> 
> What might the problem be?
> 
> nitro-0.13.0
> og-0.13.0
> 
> (from gems)
> 
> ruby 1.8.2, 1-click on Win2K
> 
> Thanks,
> 
> James Britt
> 
> --
> 
> http://www.ruby-doc.org
> http://www.rubyxml.com
> http://catapult.rubyforge.com
> http://orbjson.rubyforge.com
> http://ooo4r.rubyforge.com
> http://www.jamesbritt.com
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
> 


-- 
http://nitro.rubyforge.org
http://www.joy.gr



More information about the Nitro-general mailing list