[Nitro] Problem with Og post method

Matthew B Gardner weather at speakeasy.net
Sun Aug 19 03:53:04 EDT 2007


Hello -

On Sunday 19 August 2007 03:31, George Moschovitis wrote:
> The following works as expected in the Repository version of Og. If you
> have further questions please let me
> know.
>
>
> require "og"
>
> class Root
>   attr_accessor :name, Og::VarChar(100)
>
>   after :og_read, :call => :to_world
>
>   # more verbose (and less efficient) alternative
>   # after :og_read do
>   #   to_world()
>   # end
>
>   def initialize(name = nil)
>     @name   = name
>     @dirty  = false
>     @remove = false
>
>     to_world
>   end
>
>   def to_world
>     puts "----- POST ASPECT CALLED -----"
>   end
>
>   def dirty?
>     @dirty
>   end
>
>   def dirty!
>     @dirty = true
>   end
>
>   def clean!
>     @dirty = false
>   end
>
>   def remove!
>     @remove = true
>   end
>
>   def remove?
>     @remove
>   end
> end
>
> Og.start(
>
>   :name => "test",
>   :adapter => :mysql,
>   :user => "root",
>   :password => ",sql51e",
>   :destroy => true,
>   :evolve_schema => :full
>
> )
>
> # At the moment this is needed. Hopefuly will not be needed in
> # the final release.
>
> Aspects.setup
>
>
> r = Root.create_with :name => "George", :dirty => true
> r0 = Root.all.first

Prior to requiring the Root file,

require 'og'
Aspects.setup #=> ./lib/engine/cyclone.rb:9: undefined method `setup' for 
Aspects:Module (NoMethodError)

Using og (0.41.0)

This help at all?

Thanks again for all the assistance,
Matt


More information about the Nitro-general mailing list