sql - How to fix a multiple assignment issue? on Rails 4 -


Then, I have 3 tables accounts, users, and subscriptions that have deleted columns. Now when I delete an account, all models are requested once due to a multiple assignment error as shown below:

  for start 127.0.0.1 "/ admin / Accounts / 3 "Delayed -10-27 19:38:48 0200 by SaasAdmin :: AccountsController # HTML deleted as processed parameters: {" authenticity_token "= & gt; "Qo8NxYhezJUz2YylGxHlx2ou125UNoRuEcXbrnzyiN4 =", "id" = & gt; "3"} Select AppSetting Load (0.3ms) "App_settings". "App" setting "from" app "settings". Select "ID" ASC serial 1 tag (0.2 mms), select "tag". "Tag" from "where" tag "." Select "id" = $ 1 LIMIT 1 [["ID", 22]] SaasAdmin Load (0.2ms) "saas_admins" "ID". * "Saas_admins" where "saas_admins" from "saas_admins" by command = 4. "ID" ASC limit 1 account load "id" = $ 1 from "account", "account", "3"] (0.1 mms) to "account" where (account.Delete_at is null) and "accounts" from " Account ". Choose Membership Load (0.3ms)" Membership ". WHERE (subscriptions.deleted_at IS NULL) and" Subscription "from" Subscription "." Subscriber_id "= $ 1 and" Subscription "." Subscriber_type "= $ 2 limit 1 [["subscriber_id", 3], ["subscriber_type", "account"]] SQL (0.3ms) update "subscription" SET del Eted_at = '2014-10-27 17: 38: 48.90 9 001', deleted_at = '2014-10-27 17: 38: 48.90 9 255' WHERE (subscriptions.deleted_at IS faucet) and "subscription". " Id "= 3 PG :: Syntax Error: Error: Multiple tasks to delete the same column" deleted_at ": Update" Subscription "deleted_at = ': 38: 2014-10-27 17 48.9, 9 001' set, Deleted_at = '2014-10-27 17: 38: 48.9, 9, 025' WHERE (subscriptions.deleted_at is zero) and "membership" "id" = 3 (0.1ms) ROLLBACK whole 500 internal server error 7ms ActiveRecord: : StatementInvalid (in PG :: syntax: Error: Multiple tasks for the same column "deleted_at": Update "Subscription" deleted_at = ': 38: 2014-10-27 17 48.9, 9 001' set, = Deleted_at '2014-10-27 17: 38: 48.9, 9, 025'. Where (subscriptions.deleted_at zero  

In addition to: "async_exec") and "subscribe" "id" = 3): Active Record (4.0.4) lib / active_rec Ord / connection_adapters / postgresql_adapter.rb: 791 Additionally, SQL is generated from work as a crazy gem, so we do not write finder, we do account.destroy, the rest goes by dependency.

To solve this problem, ?

Visit the Gist link and see the full log below:


Comments