Category Archives: Ruby

Comments and notes about developing using Ruby

ActiveRecord MS SQL adapter error fixed

It looks like the SQL Server adapter error I mentioned previously has been fixed. The fix was posted yesterday (21-Apr-10).

Posted in Ruby | Comments Off on ActiveRecord MS SQL adapter error fixed

Test driven development is essential

After almost a year of using test driven development, I am now a total convert. I now feel it is so vital to good development practice that, across the board, I think I can label my previous applications as bad … Continue reading

Posted in Ruby | Comments Off on Test driven development is essential

Self referencing objects

My application has products, and each product can have components which are themselves products. I achieve this via a pair of self-referencing has_and_belongs_to_many relationships.   has_and_belongs_to_many :components,     :class_name => ‘Product’,     :join_table => "product_grouping",     :association_foreign_key … Continue reading

Posted in Ruby | Comments Off on Self referencing objects

Test driven development

I’m starting to get into test driven development. Test driven development has been advocated in the Rails community for some time (its core to the “Agile” coding methodology) but to be honest I’ve not bothered with it much. I am … Continue reading

Posted in Ruby | Comments Off on Test driven development

Bug in the activerecord-sqlserver-adapter-2.2.21 gem

Error causes INFORMATION_SCHEMA.COLUMNS to be appended to database name when using connection.select. Continue reading

Posted in Ruby | Comments Off on Bug in the activerecord-sqlserver-adapter-2.2.21 gem

Overloading ActiveRecord methods

I’m currently working on a project management tool. The way the company works is with a project being either a group of jobs or a single job. So the first job could be X0001. To this you can then add … Continue reading

Posted in Ruby | Comments Off on Overloading ActiveRecord methods

Deleting Session and Cookie entries

I’ve had a problem with clearing a users session and cookie information if they failed log on. In the past I’ve simply used: def clear_session session[:user_id] = “” session[:user_hash] = “” cookies[:user_hash] = “” end But this often fails to … Continue reading

Posted in Ruby | Comments Off on Deleting Session and Cookie entries

MS SQL server connection

I noted the couple of steps I need to connect to a Microsoft SQL server in my Rails Tiddly Wiki under “MicrosoftSQL”. I’ve need to fire up a Rails development system on another PC and have found that the gems … Continue reading

Posted in Ruby | Comments Off on MS SQL server connection

action_name_is?

I love it when a very small bit of code makes my life easier and my code simpler. Today I’ve defined a new helper method for one of my application and its done just that. This is the code def … Continue reading

Posted in Ruby | Comments Off on action_name_is?

Monitoring 2003 server – new project

I’ve been thinking about creating a Rails app to help me monitor my main Windows 2003 server. Today, one of the logical drives on the server got close to running out of space, so I realised it was time to … Continue reading

Posted in Ruby | Comments Off on Monitoring 2003 server – new project