peritor / simply_stored

A convenience wrapper around CouchDB (using CouchPotato) that supports relations and S3 attachments
Other
140 stars 16 forks source link

Entity classe nested inside the module results in invalid method name being generated #13

Open uds opened 13 years ago

uds commented 13 years ago

when I try to persist an instance of the entity class defined inside the module, I'm getting following exception:

c:/Ruby/Ruby-1.9.2/lib/ruby/gems/1.9.1/gems/couch_potato-0.4.0/lib/couch_potato/view/custom_views.rb:34:in `instance_eval': (eval):1: syntax error, unexpected '/', expecting ';' or '\n' (SyntaxError)
def association_th_shop/product_belongs_to_supplier(v...
                        ^
(eval):1: syntax error, unexpected keyword_end, expecting $end
...upplier", view_parameters); end
...                               ^
    from c:/Ruby/Ruby-1.9.2/lib/ruby/gems/1.9.1/gems/couch_potato-0.4.0/lib/couch_potato/view/custom_views.rb:34:in `view'
    from c:/Ruby/Ruby-1.9.2/lib/ruby/gems/1.9.1/gems/simply_stored-0.5.3/lib/simply_stored/couch/belongs_to.rb:24:in `belongs_to'
...

here is my entity class:

module ThShop
  class Product
    include SimplyStored::Couch

    belongs_to :supplier
  end
end 

apparently, the problem is in the slash character inserted into the method name.

I'm using simply_stored 0.5.3 with Ruby 1.9.2-p180 on Windows.