Hi,
I am doing a join of two tables with a column with same name in both. I am using "includes" to have a full join. This is giving ambiguous column error. The columns cannot be removed from either of those and renaming any of the two would involve two many changes. So, is there any way this can be resolved?
Regards,
Sumit
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/jq7KYxfa_9cJ.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
On Fri, Dec 7, 2012 at 12:20 PM, Sumit Srivastava <sumit.the...@gmail.com> wrote:
Hi,
I am doing a join of two tables with a column with same name in both. I am using "includes" to have a full join. This is giving ambiguous column error. The columns cannot be removed from either of those and renaming any of the two would involve two many changes. So, is there any way this can be resolved?
try thisFoo.includes(:bar).order('foos.name, bars.name').where('foos.name = ? AND bars.name = ?', 'fooname', 'barname')just specify the table you are trying to access.
On 7 December 2012 10:05, Jim Ruther Nill <jvn...@gmail.com> wrote:
On Fri, Dec 7, 2012 at 12:20 PM, Sumit Srivastava <sumit.the...@gmail.com> wrote:
Hi,
I am doing a join of two tables with a column with same name in both. I am using "includes" to have a full join. This is giving ambiguous column error. The columns cannot be removed from either of those and renaming any of the two would involve two many changes. So, is there any way this can be resolved?
try thisFoo.includes(:bar).order('foos.name, bars.name').where('foos.name = ? AND bars.name = ?', 'fooname', 'barname')just specify the table you are trying to access.
How to write test cases for such errors? Is it possible?
Regards,
Sumit
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/jq7KYxfa_9cJ.
For more options, visit https://groups.google.com/groups/opt_out.
--
-------------------------------------------------------------
visit my blog at http://jimlabs.heroku.com
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.