[Nitro] Problems...

George Moschovitis george.moschovitis at gmail.com
Sun Aug 28 02:39:48 EDT 2005


Hello,

either define tour classes *before* Og.setup or call og.manage_classes
after you define them.

-g.

On 8/27/05, Jeff Wood <jeff.darklight at gmail.com> wrote:
> Ok,
> 
> I have Nitro & SQLite3 both setup as rubygems on my system.
> 
> I'm trying to run the following through irb.
> 
> --SCRIPT--
> require 'rubygems'
> require 'sqlite3'
> require 'og'
> 
> db = Og.setup( :store => :sqlite, :database => 'blah.db' )
> 
> class User
>   property :name, String
>   property :pass, String
>   property :age, Fixnum
>   has_many :comments, Comment
> end
> 
> class Comment
>   property :title, String
>   property :body, String
>   belongs_to :owner, User
> end
> 
> a = User.new
> a.name = "joe blow"
> a.pass = "shhh"
> a.age = 13
> 
> b = Comment.new
> b.title = "Comment #1"
> b.body = "testing 1 2 3"
> 
> a.comments << b
> --SCRIPT--
> 
> And at the comments << b line it blows up saying that there is no
> comments method for User.
> 
> What am I doing wrong?
> 
> j.
> 
> --
> "So long, and thanks for all the fish"
> 
> Jeff Wood
> 
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
> 


-- 
http://www.gmosx.com
http://www.navel.gr
http://www.nitrohq.com




More information about the Nitro-general mailing list