Grails log is verbose… very verbose. I got used to the Rails one, especially for the stack traces. Most of the time I am not interested in hundreds of messages about Hibernate not being happy with the parameter I did pass to it. Most of the time the problem is on my side and I… Continue reading Making Grails log a Rails log
Tag: tip
Ignore files in subversion
This is just a simple procedure how to tell subversion to ignore files or directories. cd parent_directory # Check the current setup svn proplist -v . # set the editor to edit the properties export EDITOR=vi # open up editor with the properties svn propedit svn:ignore . Text editor opens (vi in my case) Here… Continue reading Ignore files in subversion
Ad-hoc fulltext search in RoR ActiveRecord
I came to a situation where I needed to search my Active record, but I did not know which field contains the information. The solution with Ferret was just three steps away… Let’s say, you want to search Stories for ‘Giant’ keyword. You have to create a Ferret index in memory (ferret gem needs to… Continue reading Ad-hoc fulltext search in RoR ActiveRecord
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
acts_as_ferret tip: uninitialized constant Ferret::Index::FieldInfos
I have upgraded acts_as_ferret plugin to the latest version and my fulltext search stopped searching. It was throwing an error message: NameError (uninitialized constant Ferret::Index::FieldInfos): /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:263:in `load_missing_constant’ /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:452:in `const_missing’ .//vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:119:in `field_infos’ .//vendor/plugins/acts_as_ferret/lib/local_index.rb:58:in `rebuild_index’ .//vendor/plugins/acts_as_ferret/lib/local_index.rb:37:in `ensure_index_exists’ .//vendor/plugins/acts_as_ferret/lib/local_index.rb:9:in `initialize’ .//vendor/plugins/acts_as_ferret/lib/class_methods.rb:304:in `new’ .//vendor/plugins/acts_as_ferret/lib/class_methods.rb:304:in `create_index_instance’ .//vendor/plugins/acts_as_ferret/lib/class_methods.rb:55:in `aaf_index’ .//vendor/plugins/acts_as_ferret/lib/class_methods.rb:120:in `find_id_by_contents’ .//vendor/plugins/acts_as_ferret/lib/class_methods.rb:176:in `ar_find_by_contents’ .//vendor/plugins/acts_as_ferret/lib/class_methods.rb:170:in `find_records_lazy_or_not’ .//vendor/plugins/acts_as_ferret/lib/class_methods.rb:86:in `find_by_contents’ If you observe the… Continue reading acts_as_ferret tip: uninitialized constant Ferret::Index::FieldInfos
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