NoMethodError: undefined method `eq’ for nil:NilClass

JRuby 1.5.2 Rails 3.0 activerecord-jdbc-adapter 0.9.7 This issue arises when setting table name with a schema name prefix. For those in the know – this is a must-have if you’re connecting to oracle using a non-owner username (activerecord-jdbc-adapter). {% highlight ruby %} class Model < ActiveRecord::Base set_table_name ‘.<table>’ end` </table></ts_code> Now – tracking this down led to lib/arel/engines/sql/relations/table.rb `def...

JRuby / PaperClip

Hello fellow developer stuck with JRuby, Paperclip file size = 0 issue 🙂 Apparently the Paperclip workaround to report the proper file size doesn’t work with the current implementation of JRuby (Windows XP). This “might” work (not thoroughly tested): iostream.rb 1234567891011if defined? Tempfile class Tempfile def size if self.path File.size(self.path) else 0 end end endend The issue is reported...

Java for the forever beginner (II)

If your JSP code is almost 2/3rd pure Java code, then you’re doing something wrong.  One easy way of knowing Java code from HTML/Snippets is to look at the PALE GREEN (see image for color tone). If the pale green is more than the white – then you must be joking. If you move the green parts to become...

How to Win Friends and Influence People

I just realized that Dale Carnegie’s principles are less than 140 characters each 😉 So – here they are in bite size. [retweet URLs reference the wiki article] And here they are in YAML Fundamental Techniques in Handling People Retweet Don’t criticize, condemn, or complain. Retweet Give honest and sincere appreciation. Retweet Arouse in the other person an eager...

The Peoplenet

Now, it’s becoming even more vivid. The Internet has grown beyond its abstract boundaries and further into reality. Iran election has started as may be yet another election, peaceful and hopeful. For all parties. With the spread of voter fraud allegations, and suspicions over the way and speed by which the votes were counted, Iranian masses started to mobilize....

Multiple has_many_polymorphs in one model

I’m trying to define multiple polymorphic relations (has_many_polymorphs plugin) from a single parent to same children. Note has many viewersNote has many editorsViewers could be either Users or GroupsEditors could be either Users or GroupsPermission is the association model with note_id, viewer_id, viewer_type, editor_id, editor_type fields Everything works out as expect as long as I have only one has_many_polymorphs...

In Saturn’s Shadow

With giant Saturn hanging in the blackness and sheltering Cassini from the Sun’s blinding glare, the spacecraft viewed the rings as never before, revealing previously unknown faint rings and even glimpsing its home world NASA Cassini Saturn Mission Imaging Highlights TED Talk Stunning!

Is it Microsoft?

This exchange happened today between me and a client while presenting the final release of an application: Me: So, let’s now log in to the system…Client: Actually, I wanted to ask about something. Is this written using Microsoft technologies?Me: No, it’s written on a different stack.Client: Shoot!Me: Why?Client: What technology is it written with?Me: It’s written in Ruby, connects...

The Finishing Touches

Yesterday, I caught myself saying “I’m now putting my finishing touches to the application”. Twice. It is a true and accurate meaning to the state of an application I’m currently delivering. So, does a “Finishing Touch” apply to software? A web application? It is a term that is probably more tied to a work of art. A painting. I...

has_many_polymorphs broken for Rails 2.1.x

The guys on has_many_polymorphs are doing a great job keeping the plugin up to date with edge Rails. This commit broke the plugin with Rails 2.1.x NameError: uninitialized constant ActiveRecord::Reflection::ClassMethods::ThroughReflection Just revert to the AssociationReflection instead of ThroughReflection logic and all should be fine. Tamer: I’m a bit of a noob, and getting this error while trying to install...