Enrique, ActiveRecord es bastante configurable como te cuentan los muchachos
en los mails anteriores. Lo suguiente no responde a tu pregunta pero igual
te lo queria contar: hay otros modos de acceder a BD con ruby si tenes ganas
de investigarlos un poco.

Podes probar http://rubyforge.org/projects/sequel/, que es un dsl muy
interesante para acceder a una BD sin necesariamente montar un "model" sobre
cada tabla. Yo recien lo estoy empezando a usar.

Tambien tenes http://rubyforge.org/projects/datamapper/ del cual todavia, no
se absolutamente nada :-).

Exitos con eso!

2008/12/10 Rodolinux <[EMAIL PROTECTED]>

> esto tambien te puede servir
>
> http://sl33p3r.free.fr/tutorials/rails/legacy/legacy_databases.html
>
> http://www.oracle.com/technology/pub/articles/saternos-rails.html
>
> Habia tambien un script dando vueltas que te hacia un scaffold a partir de
> un legacy schema, pero no recuerdo donde. Con Matías lo analizamos una vez
> con miras de hacer algo mas pero nunca avanzamos...
> espero que te sea de utilidad
>
> 2008/12/10 Rodolinux <[EMAIL PROTECTED]>
>
> Te recomiendo este libro sobre Active Record. Tiene un capitulo
>> exclusivamente dedicado a esto.
>> http://www.amazon.com/Pro-Active-Record-Databases-Rails/dp/1590598474
>>
>> 2008/12/10 Matias Pablo Brutti <[EMAIL PROTECTED]>
>>
>> Gaston Ramos dio una excelente charla de ActiveRecord , no se si la tiene
>>> publicada en algun lugar pero es una muy buena referencia como para comenzar
>>> y habla de todos estos temas.
>>> Slds.
>>>
>>>
>>> 2008/12/10 Ricardo Markiewicz <[EMAIL PROTECTED]>
>>>
>>> 2008/12/10 ENRIQUE REYES REYES <[EMAIL PROTECTED]>:
>>>> > tengo una pregunta para la comunidad
>>>> >
>>>> > si ya tengo una base de datos en mysql como puedo usar rails para
>>>> crear la
>>>> > aplicación que nos esta pidiendo el cliente,
>>>> > (la base de datos la manipulábamos con JSF pero hubo problemas de
>>>> diseño, y
>>>> > para algunas tablas habrá que hacer modificaciones a los campos, pero
>>>> toda
>>>> > la interfaz  se quiere cambiar )
>>>> > he visto algunos ejemplos sencillos con rails pero ahí se crean las
>>>> tablas
>>>> > con ruby, y se va  avanzando , Pero si ya tenemos una base creada ahí
>>>> como
>>>> > puedo implementar rails.
>>>>
>>>> Si las tablas de la DB existente no cumplen con las convenciones d
>>>> eRails, siempre podes modificarlas a mano.
>>>>
>>>> Por ejemplo, si tenes una tabla "user" que representa a tus usuarios
>>>> (rails espera que se llame users y por eso ActiveRecord no andaria),
>>>> simplemente podes poner :
>>>>
>>>>  class User < ActiveRecord::Base
>>>>    set_table_name "user"
>>>>  end
>>>>
>>>> Tambien tenes set_primary_key. Mira la API [1] para más detalles.
>>>>
>>>> El resto de los cambios simplemente los tenes como "atributos". Si
>>>> tenes una columna "color_pelo", podes accederla como @user.color_pelo
>>>> and so on.
>>>>
>>>>
>>>>
>>>> [1] http://api.rubyonrails.org/
>>>> > (pense que habia mandado un nuevo,  correo no respondido  uno :$)
>>>> >
>>>> > _______________________________________________
>>>> > Ruby mailing list
>>>> > [email protected]
>>>> >
>>>> http://lista.rubyargentina.com.ar/listinfo.cgi/ruby-rubyargentina.com.ar
>>>> >
>>>> >
>>>>
>>>>
>>>>
>>>> --
>>>> --
>>>> Ricardo Markiewicz
>>>> http://www.gazer.com.ar/
>>>> _______________________________________________
>>>> Ruby mailing list
>>>> [email protected]
>>>> http://lista.rubyargentina.com.ar/listinfo.cgi/ruby-rubyargentina.com.ar
>>>>
>>>
>>>
>>>
>>> --
>>> --
>>> --<自由編碼人>--
>>> Ing. Matias Pablo Brutti
>>> Security Consultant
>>> Email : [EMAIL PROTECTED]
>>> Site: http://www.freedomcoder.com.ar
>>>
>>> _______________________________________________
>>> Ruby mailing list
>>> [email protected]
>>> http://lista.rubyargentina.com.ar/listinfo.cgi/ruby-rubyargentina.com.ar
>>>
>>>
>>
>>
>> --
>> http://www.rodolinux.com.ar
>>
>> "I must not fear. Fear is the mind-killer. I will face my fear. I will
>> permit it to pass over me and through me. And when it has gone past I will
>> turn the inner eye to see its path. Where the fear has gone there will be
>> nothing. Only I will remain." - Bene Geserit's Fear Lethany - Dune Trilogy -
>> Frank Herbert
>>
>
>
>
> --
> http://www.rodolinux.com.ar
>
> "I must not fear. Fear is the mind-killer. I will face my fear. I will
> permit it to pass over me and through me. And when it has gone past I will
> turn the inner eye to see its path. Where the fear has gone there will be
> nothing. Only I will remain." - Bene Geserit's Fear Lethany - Dune Trilogy -
> Frank Herbert
>
> _______________________________________________
> Ruby mailing list
> [email protected]
> http://lista.rubyargentina.com.ar/listinfo.cgi/ruby-rubyargentina.com.ar
>
>


-- 
--------------------------------------------------------------
EmmanuelOga.Wordpress.com
_______________________________________________
Ruby mailing list
[email protected]
http://lista.rubyargentina.com.ar/listinfo.cgi/ruby-rubyargentina.com.ar

Responder a