Embedded '#' in column names is a show stopper in AR and there isn't an easy workaround. The embedded '#' has been my nemesis with this particular legacy DB for years so it isn't unique to Rails but I haven't yet found a way to deal with it in Rails. Other DB's all I had to do was to use double quotes or brackets and all was well. The primary key/identity column issues have workarounds but they aren't easy nor do they work well with other plugin's.

However, the Rails framework for the reasons you state. I just wish there were easier ways to implement it in a legacy DB.

Pete


Dean, Robert wrote:
I did a quick search on this and came up with several results on how to deal with "legacy" databases. It doesn't appear to be all that difficult to deal with in ActiveRecord. It's a matter of turning off certain default behaviors, particularly with regard to table naming and an identity column as the primary key.

I think the main place that RoR blazed a trail is that it brought some pragmatism back into framework design. The preference for convention over configuration has started to work its way into many other languages and platforms, including some of the recent Java specifications. JSF 2 and EJB 3 embraced this philosophy and are far more productive as a result.

-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Thorbjoern Ravn Andersen
Sent: Sunday, December 27, 2009 3:28 AM
To: Web Enabling the AS400 / iSeries
Subject: Re: [WEB400] Ruby on Rails on i site back up

Pete Helgren skrev:
The next Rails challenge is to get a rails app running using a legacy database table. That is, a table that hasn't implemented some simplifying conventions designed for Rails (like a primary key called ID and primary keys that are identity columns).
I think that Rails wants to be in control of the database tables, so retrofitting it to existing tables may be quite a challenge.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.