[#363639] Parsing geonames — 12 34 <rubyforum@...>

A Ruby newbie having trouble getting results back from geonames

16 messages 2010/06/02
[#363641] Re: Parsing geonames — Michael Fellinger <m.fellinger@...> 2010/06/02

On Wed, Jun 2, 2010 at 2:57 PM, 12 34 <rubyforum@web.knobby.ws> wrote:

[#363642] Re: Parsing geonames — 12 34 <rubyforum@...> 2010/06/02

Michael Fellinger wrote:

[#363646] installation issue with Ruby gems on Ubuntu 8.04 — Santosh Dvn <santoshdvn@...>

Hi I am installing ruby gems on ubuntu 8.04 .. while installing i got

14 messages 2010/06/02

[#363662] having a class method called only one time ? — unbewusst.sein@... (Une B騅ue)

I'd like having a class method called only one time ?

12 messages 2010/06/02

[#363756] comparing objects — Anderson Leite <andersonlfl@...>

How can I compare two objects and get true if some of his atributes are

48 messages 2010/06/03
[#364122] Re: comparing objects — Rein Henrichs <reinh@...> 2010/06/10

On 2010-06-10 06:59:40 -0700, Robert Dober said:

[#363764] Documenting Ruby 1.9: Ebook or Wiki? — Run Paint Run Run <runrun@...>

I'm writing a free ebook about Ruby 1.9 at http://ruby.runpaint.org/ .

17 messages 2010/06/04
[#363765] Re: Documenting Ruby 1.9: Ebook or Wiki? — Mohit Sindhwani <mo_mail@...> 2010/06/04

On 4/6/2010 11:30 AM, Run Paint Run Run wrote:

[#363775] Looking for ORM for 'legacy' database. — Dave Howell <groups.2009a@...>

I feel I should start with some pre-emptive apologies. I used to subscribe to this list, but haven't been reading it for a year or so, so I may have missed the answer to my question. (I did try finding it in the list archives, of course.) Also, I'm a little frustrated, and that might adversely influence the tone of this message. I'll try to avoid that, but I beg your forgiveness if I sound a little snide.

28 messages 2010/06/04
[#363895] Re: Looking for ORM for 'legacy' database. — Phrogz <phrogz@...> 2010/06/06

On Jun 4, 3:29m, Dave Howell <groups.20...@grandfenwick.net> wrote:

[#363975] Re: Looking for ORM for 'legacy' database. — Dave Howell <groups.2009a@...> 2010/06/07

[#363883] inject method of Array class — RichardSchollar <richardgschollar@...>

I have only just started using Ruby (and am a total noob, in case this

14 messages 2010/06/06

[#363944] Complex numbers contradiction? — Andrew Duncan <andrew.duncan@...>

This looks correct:

13 messages 2010/06/07
[#363951] Re: Complex numbers contradiction? — Robert Dober <robert.dober@...> 2010/06/07

On Mon, Jun 7, 2010 at 9:01 PM, Andrew Duncan <andrew.duncan@sonos.com> wrote:

[#364010] Rubyzip - `dup': can't dup NilClass (TypeError) — Luka Stolyarov <lukich@...>

Hello. I've trying to figure out rubyzip. Here's the code I had:

11 messages 2010/06/08

[#364101] Why private #binding? — Intransition <transfire@...>

Why is #binding a private method? I end up doing a lot of this:

13 messages 2010/06/10

[#364268] State of the union for Ruby CLI libraries? — John Feminella <johnf@...>

I am starting construction on a somewhat complicated internal

18 messages 2010/06/13

[#364273] Loading a module without polluting my namespace — Hagbard Celine <sin3141592@...>

Hey folks!

20 messages 2010/06/13

[#364330] shorthand — Roger Pack <rogerpack2005@...>

I read this once:

14 messages 2010/06/14

[#364342] Placement of require() and missing symbols — Eric MSP Veith <eveith@...>

-----BEGIN PGP SIGNED MESSAGE-----

16 messages 2010/06/15
[#364365] Re: Placement of require() and missing symbols — Kirk Haines <wyhaines@...> 2010/06/15

On Mon, Jun 14, 2010 at 7:18 PM, Eric MSP Veith

[#364371] datamapper blues — Martin DeMello <martindemello@...>

I'm investigating the use of DataMapper to convert an old project with

14 messages 2010/06/15

[#364402] Getting rid of self — Ralph Shnelvar <ralphs@...32.com>

22 messages 2010/06/16
[#364440] Re: Getting rid of self — Josh Cheek <josh.cheek@...> 2010/06/16

On Wed, Jun 16, 2010 at 4:31 AM, Ralph Shnelvar <ralphs@dos32.com> wrote:

[#364415] Android apps using ruby — Lakshmanan Muthukrishnan <lakshmanan@...>

Hi,

16 messages 2010/06/16
[#364439] Re: Android apps using ruby — Andrew Kaspick <akaspick@...> 2010/06/16

Lakshmanan Muthukrishnan wrote:

[#364479] Re: Android apps using ruby — Lakshmanan Muthukrishnan <lakshmanan@...> 2010/06/17

Andrew Kaspick wrote:

[#364496] nothing new in ruby_core for four days ? — Michel Demazure <michel@...>

The Ruby Core forum has no new entry since four days ago.

15 messages 2010/06/17
[#364498] Re: nothing new in ruby_core for four days ? — Brian Candler <b.candler@...> 2010/06/17

Michel Demazure wrote:

[#364529] Dear gem: still no zlib. — Dave Howell <groups.2009a@...>

I really really regret ever installing SnowLeopard.

16 messages 2010/06/17

[#364580] String comparison. Why does Ruby consider this true? — Abder-rahman Ali <abder.rahman.ali@...>

When I try for example to compare the following strings in Ruby, I get

13 messages 2010/06/18
[#364584] Re: String comparison. Why does Ruby consider this true? — Josh Cheek <josh.cheek@...> 2010/06/18

On Fri, Jun 18, 2010 at 12:46 PM, Abder-rahman Ali <

[#364628] Random Points within a Circle (#234) — Daniel Moore <yahivin@...>

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

21 messages 2010/06/19
[#364696] Re: [QUIZ] Random Points within a Circle (#234) — Caleb Clausen <vikkous@...> 2010/06/21

On 6/19/10, Daniel Moore <yahivin@gmail.com> wrote:

[#364641] Namespacing a class — Eric MSP Veith <eveith@...>

-----BEGIN PGP SIGNED MESSAGE-----

18 messages 2010/06/20

[#364815] Count substrings in string, scan too slow — Danny Challis <dannychallis@...>

Hello everyone,

18 messages 2010/06/24
[#364817] Re: Count substrings in string, scan too slow — Jes俍 Gabriel y Gal疣 <jgabrielygalan@...> 2010/06/24

On Thu, Jun 24, 2010 at 5:04 PM, Danny Challis <dannychallis@gmail.com> wrote:

[#364825] Re: Count substrings in string, scan too slow — Robert Klemme <shortcutter@...> 2010/06/24

2010/6/24 Jes俍 Gabriel y Gal疣 <jgabrielygalan@gmail.com>:

[#364850] Happy Intransition Day! — Ryan Davis <ryand-ruby@...>

Happy Intransition Day!

23 messages 2010/06/24

[#364930] Ruby in JavaScript, all projects are dead? — Alexey Petrushin <axyd80@...>

Hello, recently I've examined some of the projects that trying to bring

18 messages 2010/06/27

[#364988] Reading String Data as a File — Doug Jolley <ddjolley@...>

I use Net::HTTP to collect some data as a string. I now need to pass

25 messages 2010/06/29
[#364989] Re: Reading String Data as a File — Ryan Davis <ryand-ruby@...> 2010/06/29

[#364996] Re: Reading String Data as a File — Brian Candler <b.candler@...> 2010/06/29

Ryan Davis wrote:

[#365016] Re: Reading String Data as a File — Doug Jolley <ddjolley@...> 2010/06/29

> If it takes only a pathname argument, then you're

[#365024] Re: Reading String Data as a File — Tony Arcieri <tony.arcieri@...> 2010/06/29

On Tue, Jun 29, 2010 at 11:50 AM, Doug Jolley <ddjolley@gmail.com> wrote:

[#365036] Re: Reading String Data as a File — Robert Klemme <shortcutter@...> 2010/06/30

2010/6/29 Tony Arcieri <tony.arcieri@medioh.com>:

[#365049] Re: Reading String Data as a File — Brian Candler <b.candler@...> 2010/06/30

Robert Klemme wrote:

[#365039] pathname.rb:270: warning: `*' interpreted as argument prefix — "R.. Kumar 1.9.1 OSX" <sentinel1879@...>

/opt/local/lib/ruby1.9/1.9.1/pathname.rb:270: warning: `*' interpreted

12 messages 2010/06/30
[#365048] Re: pathname.rb:270: warning: `*' interpreted as argument prefix — Josh Cheek <josh.cheek@...> 2010/06/30

On Wed, Jun 30, 2010 at 6:11 AM, R.. Kumar 1.9.1 OSX <sentinel1879@gmail.com

Re: Looking for ORM for 'legacy' database.

From: Dave Howell <groups.2009a@...>
Date: 2010-06-08 02:02:51 UTC
List: ruby-talk #363996
On Jun 7, 2010, at 16:40 , Walton Hoops wrote:

>> How did it not work?  I guarantee something happened.  My guess would
>> that you didn't set the schema_search_path correctly in your
>> 'config/database.yml' file so it couldn't find the table, but without an
>> error message that is just a guess based on the kind of mistake I would
>> make. 

I explained this a bit more in my original message: 
> ActiveRecord did turn out to have a command available to build its migration file (I think that's what it was) FROM the schema, rather than vice versa. Unfortunately, it only managed to extract about 20% of the tables, because I'm using UUIDs for the primary keys, not sequences or integers, and it didn't know what to do with a UUID. I have no doubt that there is some place, somewhere, where I could define a new database type, but a couple of hours digging and fiddling with various files didn't lead me to the solution. 

>> You're probably right, everything assumes you will learn by following
>> the tutorials or books, which believe it or not do show you how to edit those files manually.

It seemed likely that the information existed. However, I am NOT sure that it existed somewhere other than in the core documentation. And the core documentation was quite incomprehensible. Like 95% of all the RDoc/ri information on my computer, it's organized for reference: to give you the details about a particular part of the library or module. If you don't know *which* command you want in the first place, or if you're trying to do something that isn't a function of a single command, then you can't just 'find' it in the reference documents. 

In order for me to figure it out from the primary documentation, I would first have to have a good solid understanding of how Rails works, and where it puts things. I would have to work through all the tutorials and build a bunch of little sample websites. Then I might be able to figure out how to do what I wanted to do, and whether or not it would do *everything* I required, or only *some* of it. 

Or, I could ask people who already had that knowledge, and save myself many hours of work. {smile}


>> That is the kind of error you get running a database migration. Again,
> you DO NOT need to run ANY migrations to use Rails.

To use it? No. But I didn't need to 'use' it. I needed to evaluate it. To evaluate it, I needed to work through a tutorial or two, but with MY data. And I could not find *any* information designed to introduce me to Rails that did not take for granted that there was *no* pre-existing data, because that's very much how Rails expects you to work: you build the database from Rails. There were a few bits of info here and there that hinted at how to build a migration file from an existing database, but because Rails (or ActiveRecord, or whatever component was in charge of this part) failed to handle my UUID primary keys, it didn't work. 

> It sounds to me like you never really understood how Rails actually
> worked and that's at least half the problem. 

No, actually, I'm pretty sure I understood all too well how Rails works. 

A gentleman named William Pietri commented in a blog post by Derek Sievers "Treating the database as the main focus, rather than an implementation detail is, from the Rails perspective, the wrong approach. And Rails is very opinionated software; it does its thing well, but if you want it to do something else, it's not a good match." 

This was exactly what I had already concluded. As long as I was doing things "the Rails way" stuff happened almost magically. As soon as I veered off the path, I was fighting for every inch of progress.

{search search search}

Aha! Something new! Somebody actually has a blog entry for "Ruby on Rails: UUID as your ActiveRecord primary key"

http://ariejan.net/2008/08/12/ruby-on-rails-uuid-as-your-activerecord-primary-key/

"[rake db:schema:dump] does not look at the id column in your database, but instead adds the default primary key definition from the ActiveRecord adapter. The solution is to disable the id column and create a primary key column named uuid instead."

As per a number of other Rubyist's recommendations, I've installed Sequel. Sequel *does* look at my database and automatically respects what the db defines as the primary key. (It isn't clever enough to automatically adopt the pre-existing *foreign* key constraints, but I'm willing to live with that.)

Let me repeat at this point: I am NOT here to try to slam Rails, or ActiveRecord, or such. I'm sure they're very popular for very good reasons. People have made some pretty amazing sites in preposterously short time spans with them. I just felt that my particular situation was probably not one of them.

>  That said there is nothing
> wrong with just writing a data access layer over your database (or using
> Sequel/ActiveRecord/GenericORMHere) and providing it to a web app
> written in Sinatra or something similar.  In fact, given that you have a
> pre-existing database that likely violates many of Rails conventions
> that may be the best way to go.

Interesting turn of phrase. "Violates many of Rails conventions." Indeed. "Fails to subscribe to Rails' orthodoxy" might be another way to phrase it. 

I actually used to have all my primary keys' names like 'product_id" in table 'products' in anticipation of using Rails with it one day, but I got tired of dealing with underscores, and stripped them out. Because that's really at the heart of my search for an alternative to Rails. It's not actually a pre-existing database. I can still rewrite the schema as I see fit. I *could* start from scratch, build the database from within Rails, then import the data from its present true purgatory in a badly-designed Access database. However, too many of the defaults and assumptions in Rails are ones that I'm not willing to accept. 

It's hard (for me) to tell what one really can do, or do easily, in ActiveRecord because there's so many posts on the web that are out of date. Is support for foreign keys built into it yet, or is it still an optional module? I'm not sure. But I'm sure that I don't want an ORM that *can* present a complete model of my data, I want one that *wants* to. 





In This Thread