[Nitro] Problem with Og post method

George Moschovitis george.moschovitis at gmail.com
Sun Aug 19 03:31:21 EDT 2007


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/nitro-general/attachments/20070819/461fd832/attachment.html 


More information about the Nitro-general mailing list