September 2010

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...