[Nitro] isTaggable bug
Robert Mela
rob at robmela.com
Tue Nov 6 18:21:35 EST 2007
Actually, it's probably a generic many_to_many bug.
Problem also exists in trunk.
#!/opt/local/bin/ruby
require 'og'
require 'sqlite3'
class Post
attr_accessor :name, String
is Taggable
end
Og.start(
:adapter => 'sqlite',
:name => 'tagtest',
:destroy_schema => true,
:create_schema => true
)
p=Post.new
p.name = 'post1'
t1 = Tag.new
t1.name = 'tag1'
t2 = Tag.new
t2.name = 'tag2'
p.tags << t1
p.tags << t2
p.save
This exception thrown during save. I expect it's likely to bring any
blog sample application crashing early. Not a good early impression!
Also of note -- notice printed for ogtag and ogpost, but none for
ogj_post_tag. But that's not important now :)
robert-melas-computer:~/projects/og rmela$ ruby tagtest.rb
INFO: Og uses the Sqlite store.
INFO: Dropped database 'tagtest'
INFO: Created table ogtag.
INFO: Created table ogpost.
/Users/rmela/nitro/branch/script/lib/../../og/lib/og/collection.rb:274:in
`send': undefined method `remove' for [#<Tag:0x15bec48 @count=0,
@name="tag1">]:Array (NoMethodError)
from
/Users/rmela/nitro/branch/script/lib/../../og/lib/og/collection.rb:274:in
`method_missing'
from
/Users/rmela/nitro/branch/script/lib/../../og/lib/og/collection.rb:134:in
`<<'
from tagtest.rb:26
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rob.vcf
Type: text/x-vcard
Size: 116 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071106/ce553de9/attachment-0001.vcf
More information about the Nitro-general
mailing list