[Nitro] nitro 0.40.0 changes?

transfire at gmail.com transfire at gmail.com
Wed Nov 15 08:41:41 EST 2006


Matt Rose wrote:
> I just installed the new nitro, and it absolutely broke the app I was
> working on.
>
> I tried running it as is, and I got this error:
>
> matt-roses-computer:~/ruby/start mattrose$ nitro
> /Users/mattrose/ruby/start/model.rb:2: undefined method
> `prop_accessor' for Master:Class (NoMethodError)
>          from /usr/local/lib/ruby/site_ruby/1.8/rubygems/
> custom_require.rb:27:in `gem_original_require'
>          from /usr/local/lib/ruby/site_ruby/1.8/rubygems/
> custom_require.rb:27:in `require'
>          from run.rb:10
>
> Then, when I changed all of the prop_accessor to attr_accessor, I get
> this error instead, which I don't entirely get.
>
> matt-roses-computer:~/ruby/start mattrose$ nitro
> /Users/mattrose/ruby/start/model.rb:28: uninitialized constant
> User::Article (NameError)
>          from /usr/local/lib/ruby/site_ruby/1.8/rubygems/
> custom_require.rb:27:in `gem_original_require'
>          from /usr/local/lib/ruby/site_ruby/1.8/rubygems/
> custom_require.rb:27:in `require'
>          from run.rb:10
>
> Here's the code.  Can someone tell me what I'm doing wrong?  This
> used to work fine.
>
> class Blog
> 	attr_accessor :title, String
> 	attr_accessor :description, String
> 	has_many :users, User
> 	has_many :articles, Article
> 	def initialize(title,description)
> 	  @title, at description = title,description
> 	end
> 	def to_s
> 	  @title
> 	end
> end
> class User
> 	attr_accessor :username
> 	attr_accessor :password
> 	has_many :articles, Article
> 	belongs_to :blog, Blog
> 	def initialize(username,password,blog)
> 	  @username, at password, at blog_oid = username,password,blog
> 	end
> 	def to_s
> 	  @username
> 	end
> end
>
> class Article
>    attr_accessor :title
>    attr_accessor :body
>    #has_many :comments
>    belongs_to :blog, Blog
>    belongs_to :user, User
>    def initialize(title,body,user,blog)
>      @title, at body, at user_oid, at blog_oid = title,body,user,blog
>    end
>    def to_s
>      @title
>    end
> end

Am I right in thinking that if you want Og to persist an attribute you
_must_ give the class annotation? I think that's part of the change
from prop to attr.

T.



More information about the Nitro-general mailing list