Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #3423 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

[PATCH] Problems with validates_uniqueness_of and Globalize

Reported by: alex.borovsky@gmail.com Assigned to: David
Priority: normal Milestone:
Component: ActiveRecord Version: 1.0.0
Severity: normal Keywords:
Cc:

Description

When update record, next error occurs:

PGError: ERROR: column reference "id" is ambiguous : SELECT articles.id, articles.page_group, articles.page_link, articles.body, articles.disabled, COALESCE(t_title.text, articles.title) AS title FROM articles LEFT OUTER JOIN globalize_translations AS t_title ON t_title.table_name = 'articles' AND articles.id = t_title.item_id AND t_title.facet = 'title' AND t_title.language_id = 5556 WHERE (page_link = 'index' AND page_group = 'faq' AND id <> 1) LIMIT 1

It's occurs because validates_uniqueness_of not add table name for properties.

Attachments

activerecord.patch (1.2 kB) - added by alex.borovsky@gmail.com on 01/08/06 06:46:17.
Patch, that fix problem

Change History

01/08/06 06:46:17 changed by alex.borovsky@gmail.com

  • attachment activerecord.patch added.

Patch, that fix problem

01/13/06 01:51:47 changed by marcel

  • status changed from new to closed.
  • resolution set to fixed.

(In [3402]) Disambiguate table names for columns in validates_uniquness_of's WHERE clause. Closes #3423.