Archive for November, 2005

Testing with Rails

Tuesday, November 29th, 2005

A hint with writing tests with Ruby on Rails.  If you are using fixtures, the name of the fixture is the name of the database table, not the name of the model under test.

For instance, this code:

class TaskTest < Test::Unit::TestCase
  fixtures :tbl_task

The symbol :tbl_task is the name of the database table.

ActiveOntology

Tuesday, November 29th, 2005

ActiveOntology is a library, written in Ruby, for easy manipulation of RDF and RDF-Schema models, thru a dynamic DSL based on Ruby idiom.


example = RDF::Resource.new "http://www.example.org/index.html"
example.namespaces < < :dc => “http://purl.org/dc/elements/1.1/”
example.dc_creator = RDF::Resource.new “http://www.example.org/staffid/85740″

Adjust Log Level in Ruby on Rails

Sunday, November 27th, 2005

To adjust your log level for a Rails project, you have two options.

  1. Edit config/environment.rb and set a global log level. This will override all environments (development, production, etc).
  2. Edit config/environments/production.rb, for instance to change production’s log level. This is recommended. Simply add the line config.log_level = :warn to set WARN level. This will greatly decrease the amount of logging performed.