I have two applications called app1 & app2, I have connected two database using connection establish method. I have same table name in both the databases, now I want to send selected data from app2 to app1. Here is my code for connecting two databases, please help me on this.
class Student < ActiveRecord::Base
establish_connection :adapter => "mysql2",
:database => "app1_db",
:username => "root",
:password => "root"
set_table_name "students"
belongs_to :student, :class_name => "students", :foreign_key => "fk_student_id"
end