Need to pull data from another env.

class TestBar < ActiveRecord::Base
establish_connection "development"
set_table_name :bars
set_primary_key :bar_id
end

establish_connection

Establishes the connection to the database. Accepts a hash as input where the :adapter key must be specified with the name of a database adapter (in lower-case) example for regular databases (MySQL, Postgresql, etc):

set_table_name – Sets the table name. If the value is nil or false then the value returned by the given block is used.

set_primary_key – Sets the name of the primary key column to use to the given value, or (if the value is nil or false) to the value returned by the given block.

HUGE PROPS TO http://railsforum.com/viewtopic.php?pid=148737

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: