JRuby and Polyglot

JRuby 1.5.6 (I know. Old) Rails 3.0.1 Polyglot 0.3.3 UPDATE: see easier fix below Getting the following error when bundling: {% highlight ruby %} Java::JavaLang::ArrayIndexOutOfBoundsException: An error occured while installing polyglot (0.3.3)

Rails, nested attributes and before_save callbacks

I had a Project model with a many ProjectWell (as in oil) association. Taking advantage of the accepts_nested_attributes, I was able to persist both Project and ProjectWell attributes through a single web form. {% highlight ruby %} class Project <

Test Oracle Database Views with Rails

Testing Rails with a legacy oracle schema as a backend is always a challenge (fun?). Rails relies no schema.rb to create its test database. The problem is that using the latest activerecord-oracle_enhanced-adapter (1.4.0), the application is

Rails – disable timezone conversions

In order to globally disable the use of TimeZone conversions for your (legacy?) application – here’s the proper configurations: In config/application.rb (or config/environment.rb depending on Rails version): 1 2 3 config.time_zone = 'Mountain Time (US

Heroku timezone adjustment

Setting up timezone on Heroku instance using heroku gem (command line) {% highlight ruby %} heroku config:add TZ=America/Edmonton …. heroku console Time.now => … -0700 … {% endhighlight %}Heroku apparently accepts zoneinfo timezones. It works, thank you for the useful post. I

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