Fabian is proud to present you this little tip:

Migration from 0.31.0 to 0.40.0

0.40.0

This version was in the making for ages, so there are some changes you need to make to port your application to the new version. Here come some tips to help you:

Og 0.40.0

  • use attr_accessor instead of property or prop_accessor.
  • use attr_reader instead of prop_reader
  • use attr_writer instead of prop_writer

! always specify the type after attr_accessor or it will not be recognized as a Og managed class !

example model:

class Entry
   attr_accessor :title, String
   attr_accessor :hits, Fixnum
end

  • OgModel.serializable_attributes instead of OgModel.properties

  • Postgresql store has be renamed from psql to postgresql

  • currently available adapters: postgresql, mysql, sqlite
  • Og.setup is replaced by Og.manager_options Og.start

example:

Og.manager_options = {
  :evolve_schema => :add,
  :store => 'postgresql',
  :name => 'dbname',
  :user => 'username',
  :password => ''
}
Og.start

Nitro 0.40.0

run.rb

  • use Configuration.mode = :live instead of Nitro::Runner.mode = :live
  • Nitro::Server.port default port changed from 9999 to 9000
  • prefered way of starting a nitro app is via "nitro" command now instead of "ruby run.rb"

Adapters

  • scgi has been removed, use mongrel or fastcgi instead

Namespaces

  • Controls aren't in Nitro::Form:: namespace anymore, just in Nitro::

so for setting a style for your controls:

Nitro::TextareaControl.style = ''
Nitro::TextControl.style = ''
Nitro::PasswordControl.style = ''

  • Template is in Nitro:: instead of Glue:: now, so

Nitro::Template.root = 'template'

  • The 'Markup' compiler is renamed to 'MarkupCompiler'

  • action template annotation changed from :view to :template

def my_action
 ..
end
ann :my_action, :template => :another_template

Helpers

FormHelper got reimplemented and works differently now. See Question 84 for usage of the new FormHelper.