jeff.darklight at gmail.com
Sun Aug 28 10:55:45 EDT 2005
George Moschovitis wrote:
>either define tour classes *before* Og.setup or call og.manage_classes
>after you define them.
>On 8/27/05, Jeff Wood <jeff.darklight at gmail.com> wrote:
>>I have Nitro & SQLite3 both setup as rubygems on my system.
>>I'm trying to run the following through irb.
>>db = Og.setup( :store => :sqlite, :database => 'blah.db' )
>> property :name, String
>> property :pass, String
>> property :age, Fixnum
>> has_many :comments, Comment
>> property :title, String
>> property :body, String
>> belongs_to :owner, User
>>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
>>And at the comments << b line it blows up saying that there is no
>>comments method for User.
>>What am I doing wrong?
>>"So long, and thanks for all the fish"
>>Nitro-general mailing list
>>Nitro-general at rubyforge.org
I played a bit more with my script ... and it seems that the magical
goodness of Og redefining tables doesn't work for sqlite ... so, when I
blew away the sample database, it recreated things and it seems to work now.
I think you should add some kind of an easy to read error message that
the class definitions don't match up with the database model, and that
the database model is not alterable ( as easily ) in sqlite
Anyways, thanks for your help.
Oh, also, I was trying to follow the example where you use User[ 'value
from name field' ] and it doesn't seem to like that ... yet another
incompatibility with sqlite?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Nitro-general