Ruby on Rails
Friday, June 29, 2012
Hi all,
Recently i am upgrading one of my rails app to 3.2.6. It seems the dafault_scope with options has been deprecated.
i have a scope like this default_scope :include => [:campaign, :site], :order => :'sites.name' in a relational model campaign_site
which giving this error
Mysql2::Error: Unknown column 'sites.name' in 'order clause': SELECT `campaigns`.* FROM `campaigns` INNER JOIN `campaign_sites` ON `campaigns`.`id` = `campaign_sites`.`campaign_id` WHERE `campaign_sites`.`site_id` = 11377 ORDER BY campaigns.name, sites.name
Any idea how to get around this?
Thanks in advance!
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/zdecvl86inwJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment