Forum: Nitro Og NameError

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5f65ee21e577b094753cd7d854dc39e4?d=identicon&s=25 Matthew B Gardner (Guest)
on 2007-12-27 14:42
(Received via mailing list)
Caught NameError: undefined local variable or method `attributes' for
YAML::YPath:Class
        /usr/lib/ruby/gems/1.8/gems/og-0.50.0/lib/og/util/ann_attr.rb:51:in
`serializable_attributes'
        /usr/lib/ruby/gems/1.8/gems/og-0.50.0/lib/og/manager.rb:192:in
`manageable?'
        /usr/lib/ruby/gems/1.8/gems/og-0.50.0/lib/og/manager.rb:222:in
`manageable_classes'
        /usr/lib/ruby/gems/1.8/gems/og-0.50.0/lib/og/manager.rb:218:in
`manageable_classes'
        /usr/lib/ruby/gems/1.8/gems/og-0.50.0/lib/og/manager.rb:239:in
`manage_classes'
        /usr/lib/ruby/gems/1.8/gems/og-0.50.0/lib/og/main.rb:192:in
`setup'

-Matt
45196398e9685000d195ec626d477f0e?d=identicon&s=25 Trans (Guest)
on 2007-12-28 06:25
(Received via mailing list)
On Dec 27, 8:32 am, Matthew B Gardner <weat...@speakeasy.net> wrote:
>         /usr/lib/ruby/gems/1.8/gems/og-0.50.0/lib/og/manager.rb:239:in
> `manage_classes'
>         /usr/lib/ruby/gems/1.8/gems/og-0.50.0/lib/og/main.rb:192:in `setup'

I though I already fixed this, but maybe George hasn't had the chance
to apply the patch. The solution is simply that #attributes should be
#instance_attributes.

T.
5f65ee21e577b094753cd7d854dc39e4?d=identicon&s=25 Matthew B Gardner (Guest)
on 2007-12-28 12:21
(Received via mailing list)
Hello --

On Thursday 27 December 2007 23:47, Trans wrote:
> >         /usr/lib/ruby/gems/1.8/gems/og-0.50.0/lib/og/manager.rb:218:in
> T.
Thanks for the reply -- I fixed the issue there and then another that
popped
up in sql.rb as well. However, more problems arose once I got my
application
running -- searching for data in a table was giving incorrect results
and
saving an object was trying to save it to its parent's table. Also, the
parent table had fields which it shouldn't have...fields declared only
in
another child (not the same child that I encountered the saving problem
with). Are these problems related to the pending patch?

Thanks again,
Matt
407f866e9a1b959de956ae560239adfe?d=identicon&s=25 Jonathan Buch (Guest)
on 2007-12-28 15:30
(Received via mailing list)
Hi,

[...]
> saving an object was trying to save it to its parent's table. Also, the
> parent table had fields which it shouldn't have...fields declared only in
> another child (not the same child that I encountered the saving problem
> with). Are these problems related to the pending patch?

if you are using STI (single table inheritance, `is
SingleTableInherited`
I think it is now), that is the correct behaviour.
If not, it's a bug.

Jo
5f65ee21e577b094753cd7d854dc39e4?d=identicon&s=25 Matthew B Gardner (Guest)
on 2008-01-05 07:33
(Received via mailing list)
Hello --

> Thanks for the reply -- I fixed the issue there and then another that
> popped up in sql.rb as well. However, more problems arose once I got my
> application running -- searching for data in a table was giving incorrect
> results and saving an object was trying to save it to its parent's table.
> Also, the parent table had fields which it shouldn't have...fields declared
> only in another child (not the same child that I encountered the saving
> problem with). Are these problems related to the pending patch?
>

I'm still encountering the above issues, although I'm also dealing with
more
issues now. I deleted my tables to see if Og just needed to rebuild
them...that didn't work and actually created more problems. RootObject
is a
parent of Account, but RootObject is adding and deleting Account's
columns
and an Account table isn't being created at all. Character is also a
child of
RootObject and RootObject is taking two of the columns in Character as
its
own. Here's a printout -- none of the columns printed should be part of
RootObject:

INFO: Created table `ogrootobject`.
 INFO: Adding field 'its_id' to '`ogrootobject`'
 INFO: Adding field 'its_update' to '`ogrootobject`'
 INFO: Adding field 'bts_id' to '`ogrootobject`'
 INFO: Adding field 'bts_update' to '`ogrootobject`'
 INFO: Adding field 'logins' to '`ogrootobject`'
 INFO: Adding field 'type' to '`ogrootobject`'
 INFO: Adding field 'password' to '`ogrootobject`'
 INFO: Adding field 'created_host' to '`ogrootobject`'
 INFO: Adding field 'last_host' to '`ogrootobject`'
 INFO: Adding field 'color' to '`ogrootobject`'
 INFO: Adding field 'hints' to '`ogrootobject`'
 INFO: Adding field 'linemode' to '`ogrootobject`'
 INFO: Adding field 'compact' to '`ogrootobject`'
 INFO: Adding field 'pagebreak' to '`ogrootobject`'
 INFO: Removing field 'pagebreak' from '`ogrootobject`'
 INFO: Removing field 'logins' from '`ogrootobject`'
 INFO: Removing field 'created_host' from '`ogrootobject`'
 INFO: Removing field 'compact' from '`ogrootobject`'
 INFO: Removing field 'type' from '`ogrootobject`'
 INFO: Removing field 'its_id' from '`ogrootobject`'
 INFO: Removing field 'last_host' from '`ogrootobject`'
 INFO: Removing field 'its_update' from '`ogrootobject`'
 INFO: Removing field 'hints' from '`ogrootobject`'
 INFO: Removing field 'password' from '`ogrootobject`'
 INFO: Removing field 'bts_id' from '`ogrootobject`'
 INFO: Removing field 'linemode' from '`ogrootobject`'
 INFO: Removing field 'color' from '`ogrootobject`'
 INFO: Removing field 'bts_update' from '`ogrootobject`'
 INFO: Adding field 'aliases' to '`ogrootobject`'
 INFO: Adding field 'account_oid' to '`ogrootobject`'

Does this point to something I should be doing that I'm not? My
application is
pretty much paralyzed until I get this issue fixed, so any help is very
much
appreciated.

Thanks,
Matt
407f866e9a1b959de956ae560239adfe?d=identicon&s=25 Jonathan Buch (Guest)
on 2008-01-06 12:35
(Received via mailing list)
Hi,

> Does this point to something I should be doing that I'm not? My
> application is pretty much paralyzed until I get this issue
> fixed, so any help is very much appreciated.

like I wrote before, if you are using STI, this is the correct
behaviour.

That it dropps fields, tells me that you must be using
`:evolve_schema => :full`, which hmm.. might not be good with STI.

If you don't use STI, it's a bug and Trans should fix it.  :P

class Model1
   attr_accessor :chunky, String
end
class Model2 < Model1
   attr_accessor :bacon, String
end
Og.start
Model2.table # => 'ogmodel2'

If this prints ogmodel1, there's a bug.  The other Og guys here
should fix it.  :P

Jo
This topic is locked and can not be replied to.