The Neurochild wrote:
> On Nov 7, 9:06 am, Phillip Koebbe <[EMAIL PROTECTED]>
> wrote:
>> You don't need a class since you're just building a sql statement. You
>> need to deal with tables and columns, not classes. Look back at how I
>> defined foreign_key and delete_foreign_key. delete_foreign_key assumes a
>> naming convention that is used in foreign_key. If you use a different
>> naming convention for your foreign keys, adjust both methods
>> accordingly.
> 
> So I put both methods on one files and load them in the environment?
> That's it.

Right. Here's the skinny on how I do it:

I have a file

{RAILS_ROOT}/lib/pg_ext.rb

that contains the methods. Then, at the bottom of 
{RAILS_ROOT}/config/environment.rb, I have

require 'pg_ext'

Remember to restart the server or console after making changes to the 
environment.

Peace.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to