[Nitro] [BUG] bryan's og_manager_fix

Bryan Soto bryan.a.soto at gmail.com
Fri Jan 27 15:40:23 EST 2006


Hi Chris,

On 1/27/06, Chris Farmiloe <chris at motionpath.com> wrote:
>
>
> Hi guys:
>
> Just pulled down latest bits from repo and found some trouble with the
> og_manager_fix that adds the Manager.managed? methods when combined with
> STI (may only show up with psql adaptor or others that enforce
> constraints.
>
> the following Nitro app should illustrate the problem (get your Cut&Paste
> on)
>
> ---------------------------
> #!/opt/local/bin/ruby
>
> require 'rubygems'
>
> require 'nitro'
> require 'og'
> include Nitro
>
>
>
> class Thing
>   property :name
>

belongs_two :ClassTwo  # Add this here otherwise the join table won't be
created.

end
>
>
>
> class ClassOne
>   property :name, String
> end
>
> class ClassTwo < ClassOne
>   property :this, String
>   has_many :things, Thing
> end
>
> Og.setup (
>   :store => :psql,
>   :address => 'xx',
>   :name => 'xx',
>   :user => 'xx',
>   :password => 'xx',
>   :destroy_tables => true,
>   :evolve_schema => true,
>   :evolve_schema_cautious => false
> )
>
> # start nitro
>
> Nitro.run
> ---------------------------------
>

I finally caved and installed Postgres.

I, [2006-01-27T12:38:38.161476 #11080]  INFO -- : Og uses the Psql store.
D, [2006-01-27T12:38:38.397137 #11080] DEBUG -- : Dropped database table
ogclassone
D, [2006-01-27T12:38:38.434824 #11080] DEBUG -- : Dropped database table
ogthing
D, [2006-01-27T12:38:38.458815 #11080] DEBUG -- : Dropped database table
ogclasstwo
D, [2006-01-27T12:38:38.502542 #11080] DEBUG -- : Og manageable classes:
[ClassTwo, ClassOne, Thing]
NOTICE:  CREATE TABLE will create implicit sequence "ogclassone_oid_seq" for
serial column "ogclassone.oid"
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
"ogclassone_pkey" for table "ogclassone"
I, [2006-01-27T12:38:38.691184 #11080]  INFO -- : Created table
'ogclassone'.
NOTICE:  CREATE TABLE will create implicit sequence "ogclasstwo_oid_seq" for
serial column "ogclasstwo.oid"
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
"ogclasstwo_pkey" for table "ogclasstwo"
I, [2006-01-27T12:38:38.773345 #11080]  INFO -- : Created table
'ogclasstwo'.
NOTICE:  CREATE TABLE will create implicit sequence "ogthing_oid_seq" for
serial column "ogthing.oid"
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
"ogthing_pkey" for table "ogthing"
I, [2006-01-27T12:38:38.889331 #11080]  INFO -- : Created table 'ogthing'.
D, [2006-01-27T12:38:38.897719 #11080] DEBUG -- : PostgreSQL processing
foreign key constraints
D, [2006-01-27T12:38:38.982985 #11080] DEBUG -- : PostgreSQL finished
setting constraints. 1 constraints were added in 0.08 seconds.

My patch is innocent. ;)

bryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/nitro-general/attachments/20060127/168aabd4/attachment.html 


More information about the Nitro-general mailing list