We needed to cache a Ruby class method calling the Ferret indexing engine. “Yurii Rashkovskii”:http://rashkovskii.com/tags/caches developed a great library called “Caches.rb”:http://pad.verbdev.com/cachesrb/. When I googled it out, it seemed very simple to use and promised to do *EXACTLY* what I need (even the default timeout was *JUST IT*). I especially liked the very Rails-like tutorial “Don’t… Continue reading Utilizing Caches.rb with Ferret
Category: How-to
Calling Oracle stored procedure from rails
Sometimes it is necessary to reuse existing logic from stored procedures. This line of code shows how to call a stored procedure in Oracle. ActiveRecord::Base.connection.execute(‘BEGIN do_the_calculation; END;’)
From pictures to picturables
This article tries to explain how to convert existing class in Ruby on Rails to a class that can be used in polymorphic association class. As the beginning, I do recommend to read article about polymorphic associations. It explains what they are and how they work. The whole process will be described on classes Picture… Continue reading From pictures to picturables
RSpec for Ruby on Rails
Behaviour driven development is currently in. The best ay how to get in touch with it is to setup your own environment and make few examples.Nevertheless, if you prefer to start with a bit of theory, go to http://behaviour-driven.org/.This article describes simple procedure to setup Rspec to work together with ruby on rails. Installation of… Continue reading RSpec for Ruby on Rails
Ruby on Rails with Oracle
I am working on a prototype in an big company and they do store data in Oracle. It took me some time to set up RoR working with Oracle. So, here are the things you need to do. First of all, there is a great tutorial on Oracle site: http://www.oracle.com/technology/pub/articles/haefel-oracle-ruby.html. In fact, you need to:… Continue reading Ruby on Rails with Oracle
How to show performance statistics in a chart
Working on performance tests and tuning is an interesting and challenging job. One has to prepare tests, execute and also evaluate them. The preparation and execution is not always easy, but it is manageable. The evaluation of the tests comes with an interesting problem. The problem is called data visualization. I was testing a system… Continue reading How to show performance statistics in a chart
Syntax error without obvious reason
I just made a bad experience with ruby I would like to share. I wanted to upgrade my SuSE Linux 9.1 to version 10. Failed… during the upgrade process my machine ended up in a strange state. I was not able to boot neither from hard drive nor from Windows XP installation disk. I had… Continue reading Syntax error without obvious reason
Visualize your Rails schema
While doing some Ruby on Rails code refactoring, I realized I’d like to visualize the database schema of the application. An easy possibility is to print out db/schema.rb. This seems a bit too linear and little visual to me. OK, I’d better keep thinking. An enterprise approach would be to take a CASE machinery and… Continue reading Visualize your Rails schema
Full text search in Ruby on Rails 3 – ferret
There are several possibilities how to use ferret in RoR. This post will show the easy way – using the acts_as_ferret plugin. To show the syntax and code, I will use the same data objects as in the Full text search in ruby on rails 2 – MySQL Installation Ferret installation is easy gem install… Continue reading Full text search in Ruby on Rails 3 – ferret
Functional testing with Watir
So, we have a public web application accessible 24×7. Even if we do not process financial transactions or control airport traffic, this poses a kind of stress upon us. To relieve it, functional testing is our true companion. By functional testing I mean simulating an end user’s traversal through the application. This means that, contrary… Continue reading Functional testing with Watir