[Nitro] Og examples

Bryan Soto bryan.a.soto at gmail.com
Thu Nov 24 01:18:58 EST 2005


Here's a working version. Hopefully it's enough to give you a start. Passing
[] as the type for :domain works for storing class A as it's done via YAML
and should load correctly. I'm not sure why it's necessary though...

------------------------------------------
require 'og'

class A; end

class B
 property :domain, []
end

Og.setup(
   :database => 'test',
# :base_dir => 'other_directory_name', # In case you don't want kirbydb
   :store => :kirby
)

r = B.new

o = A.new

r.domain = o

puts r.domain

r.save


On 11/23/05, itsme213 <itsme213 at hotmail.com> wrote:
>
> Where can I find some basic examples of using Og with Kirbybase or
> Filesystem store?
>
> I tried the below and it dies on the r.save.
> c:/ruby/lib/ruby/gems/1.8/gems/og-0.25.0/lib/og/entity.rb:376:in
> `method_missing': undefined method `ogmanager' for B:Class (NoMethodError)
> from c:/ruby/lib/ruby/gems/1.8/gems/og-0.25.0/lib/og/entity.rb:14:in
> `save'
> from C:/des/desktop/citi/idem/domain model/role_model.rb:22
> Process ruby exited with code 1
>
> Also there are errors in the testcases included in og.
>
> Thanks!
> -----------------------------------
>
> require 'og'
>
> class A; end
>
> class B
> property :domain, A
> end
>
> db = Og::Store.new(
>     :database => 'test',
>     :adapter  => 'kirby'
> )
>
> r = B.new
>
> o = A.new
>
> r.domain = o
>
> puts r.domain
>
> r.save
> o.save
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/nitro-general/attachments/20051124/23b37f74/attachment.html 


More information about the Nitro-general mailing list