[Nitro] litte patch to og/relation.rb

jfwittmann neokolor at gmx.de
Tue Jun 20 13:01:32 EDT 2006


Without my patch og can't handle following module/class structure.
The problem was a regex. With the old regex you can only handle og 
classes that are in one module but not in a sub-Module too.
That does mean you could handle og classes like:
Module->Class

but with my changes you can handle classes like too:

Module->Module*n->Class

My intention for this was  use og in camping like classes too.

Ok ?


example:
require 'og'
module Gallery
    def self.create
      Og.start
      Og.thread_safe=false
    end
end

module Gallery::Models
  class Image
    prop_accessor :filename, String
    has_one :image_details
  end
 
  class ImageDetail
    prop_accessor :comment,  String
    belongs_to :image
  end
end


Gallery.create

imgd =  Gallery::Models::ImageDetail.new
imgd.save

img =  Gallery::Models::Image.new
img.save

Bryan Soto wrote:
> Would it be possible for you to supply a testcase to go with this? I
> had a go with the example you gave, but had no luck making it work.
>
> Thanks,
>
> Bryan
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
>
>
>   




More information about the Nitro-general mailing list