[Nitro] Problem with Og post method

Matthew B Gardner weather at speakeasy.net
Sat Aug 18 12:05:32 EDT 2007


$:.unshift "lib" if !$:.include? "lib"

# note that og and og/relation have already been required in another file

class Root
  include Og::EntityMixin

	property :name, VarChar(100)

	def initialize name
		@name   = name
		@dirty  = false
    		@remove = false
    
    		to_world
	end

  	def to_world
    		world.objects << self # world is a public method
  	end

	def dirty?
		@dirty
	end

	def dirty!
		@dirty = true
	end

	def clean!
		@dirty = false
	end
  
  	def remove!
    		@remove = true
  	end
  
  	def remove?
    		@remove
  	end

	post :to_world, :on => [:og_read]

end

Please let me know if more info is required. Thanks for any help,
Matt

On Saturday 18 August 2007 11:26, George Moschovitis wrote:
> Please provide a simple example (small source file) that demonstrated the
> problem.
>
> -g.
>
> On 8/16/07, Matthew B Gardner <weather at speakeasy.net> wrote:
> > Hello, I'm struggling a little with using the post method. I have two
> > classes,
> > Root and Account < Root, and I can't get post to work inside of the Root
> > class. However, it does work in the Account class. When I try to utilize
> > the
> > method in Root, I get:
> >
> > `method_missing': undefined method `post' for Root:Class (NoMethodError)
> >
> > I'm using post with the following arguments:
> >
> > post :to_world, :on => [:og_read], where to_world is a Root method
> >
> > The only difference between the two classes, with regards to Og, is that
> > Account is Timestamped and requires glue/timestamped (though I got the
> > same
> > errors in Root when I added the same data). Although post seems to work
> > fine
> > in Account, I did get the same NoMethodError for Account two or three
> > times
> > in a row, though I haven't been able to duplicate it. It happened right
> > after
> > I removed my original post method attempt from Root and returned it to
> > Account.
> >
> > I'd of course like to figure this issue out, if possible, but the purpose
> > is
> > trying to test whether or not I can place the post method in Root and
> > have Account#og_read call to_world. This is probably easier to answer?
> >
> > Thank you for any help,
> > Matt
> > _______________________________________________
> > Nitro-general mailing list
> > Nitro-general at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/nitro-general


More information about the Nitro-general mailing list