[Nitro] nitro 0.40.0 changes?

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


Matt Rose wrote:
> Where is this documented?
>
> I have to say, I'm not very impressed right now.  right now, it looks
> like all my work has to be re-written from scratch.    I've finally
> figured out how to get my app to start, and the console is great to
> work with, but I still can't get past the starting gate.

I understand the feeling. It can be frustrating. And Nitro's been going
through a lot of changes over the last year. But thankfully with this
and the next release that looks to finally settle down.

> I have two classes.  Master is just a one-off table that holds some
> meta-information.  It has no relations to any other table.  But while
> I can use other models, I can't use this one.
>
> here's the class.
>
> class Master
>    attr_accessor :title
>    attr_accessor :description
>    attr_accessor :user
>    attr_accessor :pass
>    def initialize(title,desc,user,pass)
>      @title, at description, at user, at pass = title,desc,user,pass
>    end
>    def to_s
>      @title
>    end
> end
>
> 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
>
> and here's the output.
>
>
>  >> matt-roses-computer:~/ruby/start mattrose$ nitro console
> INFO: Og uses the Sqlite store.
> /usr/local/lib/ruby/1.8/logger.rb:525:in `initialize':Errno::ENOENT:
> No such file or directory - log/app.log
>  >> Blog.all
> =>
>  >> Master.all
> NoMethodError: undefined method `all' for Master:Class
>          from (irb):2
>          from :0

I'm thinking Master is not getting "enchanted" by Og. Try adding the
class types:

 class Master
   attr_accessor :title, String
    attr_accessor :description, String
    attr_accessor :user, String
    attr_accessor :pass, String
    def initialize(title,desc,user,pass)
      @title, at description, at user, at pass = title,desc,user,pass
    end
    def to_s
      @title
    end
 end

And see how that effects it.

T.



More information about the Nitro-general mailing list