Ruby on Rails Wednesday, April 5, 2017
I am trying to connect 2 different sqlite3 databases. I can connect them using establish connection, but now I want to join users table to the second sqlite db using a has_many :through in Rails.
I keep getting an exception:
SQLite3::SQLException: no such table: udt_user_links: SELECT "users".* FROM "users" INNER JOIN "udt_user_links" ON "users"."id" = "udt_user_links"."user_id" WHERE "udt_user_links"."user_linkable_id" = ? AND "udt_user_links"."user_linkable_type" = ? AND "udt_user_links"."token" = ?
I am pretty sure what I need to do is set a table_prefix_name to do this like such but my big problem is how to get the name.
I see that one could run the command: PRAGMA database_list; is the sqlite command prompt and get back the name for the current session... but I would need to get both db names dynamically.
Has anyone connected up two databases using a has_many through: like this??
Thanks in advance,
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
To post to this group, send email to firstname.lastname@example.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/eaf88f13-5bac-4d23-a976-0af719587db3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Posted by Ruby on Rails at 11:41 AM