Consider that we have two models; Well and SurveryPoints . A Well represent an oil/gas/water well, each with multiple SurveyPoints. A SurveyPoint represent the well’s coordinate at a certain depth. class Well < ActiveRecord::Base has_many :survey_
JRuby – can’t convert Hash into String
I’ve recently upgraded a JRuby/Rails application from JRuby 1.6.3 (1.8 compatibility mode) to 1.6.8 (1.9 mode). Everything was working out fine except for actions relying on internal CSV library (FasterCSV in 1.
newrelic – undefined method `-’ for nil:NilClass
Using JRuby with trinidad (developer mode) – I was intermittently getting this error. Apparently thrown as estimated_time for the transaction was returning nil. I was also having all sorts of other issues (undefined method `metric_name’ for nil:NilClass) with
JRuby/Rails Streaming in development environment (and beyond)
Rails streaming is a great feature that allows you to optimize on server resources when dealing with large generated content. However – it might be a bit tricky to validate and test in local development. First off – a local server that
JQuery Autocomplete updating a document element (not the dropdown)
I came across the requirement of updating a page element from the result of an Autocomplete. The server results were to be placed in a select element as set of option items. I had to overwrite some JQuery UI Autocomplete
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