foreigner

How can I prevent Rails from “pluralizing” a column name?

…衆ロ難τιáo~ 提交于 2019-12-08 07:52:41
问题 I'm using dwilkie's foreigner plugin for rails. I have a table creation statement that looks like: create_table "agents_games", :force => true, :id => false do |t| t.references :agents, :column => :agent_id, :foreign_key => true, :null => false t.references :games, :column => :game_id, :foreign_key => true, :null => false end However, this generates the following SQL: [4;35;1mSQL (2.7ms)[0m [0mCREATE TABLE "agents_games" ("agents_id" integer NOT NULL, "games_id" integer NOT NULL) [0m I want

foreigner - remove foreign key

こ雲淡風輕ζ 提交于 2019-12-03 14:46:35
问题 I am trying to use mailboxer in my rails 4 app. A problem is arising when i try to deploy the db. The error occurs in creating the mailboxer conversations table, which has dependencies in notifications table. I am trying to remove the foreign key for notifications conversations. I created a migration which says: change_table :notifications do |t| t.remove_foreign_key :conversations However, the rake aborts and says a foreign key does not exist. rake aborted! An error has occurred, this and