Skip to content

Instantly share code, notes, and snippets.

@robbl
Created February 1, 2011 15:21
Show Gist options
  • Save robbl/805997 to your computer and use it in GitHub Desktop.
Save robbl/805997 to your computer and use it in GitHub Desktop.
ActiveRecord::StatementInvalid (Mysql::Error: Unknown column 'store37_0.attribute8_id' in 'on clause': (SELECT DISTINCT COUNT(DISTINCT `elements_0`.id) FROM `elements` `elements_0` STRAIGHT_JOIN `element_types` `element_types_0` ON (`element_types_0`.`id`=`elements_0`.`element_type_id`) STRAIGHT_JOIN `lists` `lists_0` ON (`lists_0`.`id`=`elements_0`.`list_id` AND `lists_0`.`id`=17) STRAIGHT_JOIN `neighbourhoods` `neighbourhoods_0` ON (`neighbourhoods_0`.`id`=`lists_0`.`neighbourhood_id`) STRAIGHT_JOIN `store39` `store39_0` ON (`store39_0`.`id`=`elements_0`.`attributes_store_id` AND `elements_0`.`attributes_store_type`='AttributesStore::DocumentProjectCreate') WHERE ((((((((0 | `neighbourhoods_0`.`read_rights_mask`) & (`neighbourhoods_0`.`read_rights` | ~`neighbourhoods_0`.`read_rights_mask`)) | `lists_0`.`read_rights_mask`) & (`lists_0`.`read_rights` | ~`lists_0`.`read_rights_mask`)) | `element_types_0`.`read_rights_mask`) & (`element_types_0`.`read_rights` | ~`element_types_0`.`read_rights_mask`)) | `elements_0`.`read_rights_mask`) & (`elements_0`.`read_rights` | ~`elements_0`.`read_rights_mask`)) & (4 | !ISNULL(NULL) | 2*!ISNULL(NULL)) > 0) UNION (SELECT DISTINCT COUNT(DISTINCT `elements_0`.id) FROM `elements` `elements_0` STRAIGHT_JOIN `element_types` `element_types_0` ON (`element_types_0`.`id`=`elements_0`.`element_type_id`) STRAIGHT_JOIN `lists` `lists_0` ON (`lists_0`.`id`=`elements_0`.`list_id` AND `lists_0`.`id`=17) STRAIGHT_JOIN `neighbourhoods` `neighbourhoods_0` ON (`neighbourhoods_0`.`id`=`lists_0`.`neighbourhood_id`) STRAIGHT_JOIN `store36` `store36_0` ON (`store36_0`.`id`=`elements_0`.`attributes_store_id` AND `elements_0`.`attributes_store_type`='AttributesStore::DocumentProjectRead') WHERE ((((((((0 | `neighbourhoods_0`.`read_rights_mask`) & (`neighbourhoods_0`.`read_rights` | ~`neighbourhoods_0`.`read_rights_mask`)) | `lists_0`.`read_rights_mask`) & (`lists_0`.`read_rights` | ~`lists_0`.`read_rights_mask`)) | `element_types_0`.`read_rights_mask`) & (`element_types_0`.`read_rights` | ~`element_types_0`.`read_rights_mask`)) | `elements_0`.`read_rights_mask`) & (`elements_0`.`read_rights` | ~`elements_0`.`read_rights_mask`)) & (4 | !ISNULL(NULL) | 2*!ISNULL(NULL)) > 0) UNION (SELECT DISTINCT COUNT(DISTINCT `elements_0`.id) FROM `elements` `elements_0` STRAIGHT_JOIN `element_types` `element_types_0` ON (`element_types_0`.`id`=`elements_0`.`element_type_id`) STRAIGHT_JOIN `lists` `lists_0` ON (`lists_0`.`id`=`elements_0`.`list_id` AND `lists_0`.`id`=17) STRAIGHT_JOIN `neighbourhoods` `neighbourhoods_0` ON (`neighbourhoods_0`.`id`=`lists_0`.`neighbourhood_id`) STRAIGHT_JOIN `store37` `store37_0` ON (`store37_0`.`id`=`elements_0`.`attributes_store_id` AND `elements_0`.`attributes_store_type`='AttributesStore::DocumentProjectUpdate') STRAIGHT_JOIN `polyglots` `polyglots_0` ON (`polyglots_0`.`id`=`store37_0`.`attribute8_id`) STRAIGHT_JOIN `plain_texts` `plain_texts_0` ON (`polyglots_0`.`id`=`plain_texts_0`.`polyglot_id` AND `plain_texts_0`.`language`='en') WHERE ((((((((0 | `neighbourhoods_0`.`read_rights_mask`) & (`neighbourhoods_0`.`read_rights` | ~`neighbourhoods_0`.`read_rights_mask`)) | `lists_0`.`read_rights_mask`) & (`lists_0`.`read_rights` | ~`lists_0`.`read_rights_mask`)) | `element_types_0`.`read_rights_mask`) & (`element_types_0`.`read_rights` | ~`element_types_0`.`read_rights_mask`)) | `elements_0`.`read_rights_mask`) & (`elements_0`.`read_rights` | ~`elements_0`.`read_rights_mask`)) & (4 | !ISNULL(NULL) | 2*!ISNULL(NULL)) > 0) UNION (SELECT DISTINCT COUNT(DISTINCT `elements_0`.id) FROM `elements` `elements_0` STRAIGHT_JOIN `element_types` `element_types_0` ON (`element_types_0`.`id`=`elements_0`.`element_type_id`) STRAIGHT_JOIN `lists` `lists_0` ON (`lists_0`.`id`=`elements_0`.`list_id` AND `lists_0`.`id`=17) STRAIGHT_JOIN `neighbourhoods` `neighbourhoods_0` ON (`neighbourhoods_0`.`id`=`lists_0`.`neighbourhood_id`) STRAIGHT_JOIN `store38` `store38_0` ON (`store38_0`.`id`=`elements_0`.`attributes_store_id` AND `elements_0`.`attributes_store_type`='AttributesStore::DocumentAssignmentRead') WHERE ((((((((0 | `neighbourhoods_0`.`read_rights_mask`) & (`neighbourhoods_0`.`read_rights` | ~`neighbourhoods_0`.`read_rights_mask`)) | `lists_0`.`read_rights_mask`) & (`lists_0`.`read_rights` | ~`lists_0`.`read_rights_mask`)) | `element_types_0`.`read_rights_mask`) & (`element_types_0`.`read_rights` | ~`element_types_0`.`read_rights_mask`)) | `elements_0`.`read_rights_mask`) & (`elements_0`.`read_rights` | ~`elements_0`.`read_rights_mask`)) & (4 | !ISNULL(NULL) | 2*!ISNULL(NULL)) > 0) UNION (SELECT DISTINCT COUNT(DISTINCT `elements_0`.id) FROM `elements` `elements_0` STRAIGHT_JOIN `element_types` `element_types_0` ON (`element_types_0`.`id`=`elements_0`.`element_type_id`) STRAIGHT_JOIN `lists` `lists_0` ON (`lists_0`.`id`=`elements_0`.`list_id` AND `lists_0`.`id`=17) STRAIGHT_JOIN `neighbourhoods` `neighbourhoods_0` ON (`neighbourhoods_0`.`id`=`lists_0`.`neighbourhood_id`) STRAIGHT_JOIN `store39` `store39_0` ON (`store39_0`.`id`=`elements_0`.`attributes_store_id` AND `elements_0`.`attributes_store_type`='AttributesStore::DocumentAssignmentUpdate') STRAIGHT_JOIN `polyglots` `polyglots_0` ON (`polyglots_0`.`id`=`store39_0`.`attribute8_id`) STRAIGHT_JOIN `plain_texts` `plain_texts_0` ON (`polyglots_0`.`id`=`plain_texts_0`.`polyglot_id` AND `plain_texts_0`.`language`='en') WHERE ((((((((0 | `neighbourhoods_0`.`read_rights_mask`) & (`neighbourhoods_0`.`read_rights` | ~`neighbourhoods_0`.`read_rights_mask`)) | `lists_0`.`read_rights_mask`) & (`lists_0`.`read_rights` | ~`lists_0`.`read_rights_mask`)) | `element_types_0`.`read_rights_mask`) & (`element_types_0`.`read_rights` | ~`element_types_0`.`read_rights_mask`)) | `elements_0`.`read_rights_mask`) & (`elements_0`.`read_rights` | ~`elements_0`.`read_rights_mask`)) & (4 | !ISNULL(NULL) | 2*!ISNULL(NULL)) > 0) UNION (SELECT DISTINCT COUNT(DISTINCT `elements_0`.id) FROM `elements` `elements_0` STRAIGHT_JOIN `element_types` `element_types_0` ON (`element_types_0`.`id`=`elements_0`.`element_type_id`) STRAIGHT_JOIN `lists` `lists_0` ON (`lists_0`.`id`=`elements_0`.`list_id` AND `lists_0`.`id`=17) STRAIGHT_JOIN `neighbourhoods` `neighbourhoods_0` ON (`neighbourhoods_0`.`id`=`lists_0`.`neighbourhood_id`) STRAIGHT_JOIN `store44` `store44_0` ON (`store44_0`.`id`=`elements_0`.`attributes_store_id` AND `elements_0`.`attributes_store_type`='AttributesStore::DocumentEstimateCreate') WHERE ((((((((0 | `neighbourhoods_0`.`read_rights_mask`) & (`neighbourhoods_0`.`read_rights` | ~`neighbourhoods_0`.`read_rights_mask`)) | `lists_0`.`read_rights_mask`) & (`lists_0`.`read_rights` | ~`lists_0`.`read_rights_mask`)) | `element_types_0`.`read_rights_mask`) & (`element_types_0`.`read_rights` | ~`element_types_0`.`read_rights_mask`)) | `elements_0`.`read_rights_mask`) & (`elements_0`.`read_rights` | ~`elements_0`.`read_rights_mask`)) & (4 | !ISNULL(NULL) | 2*!ISNULL(NULL)) > 0) UNION (SELECT DISTINCT COUNT(DISTINCT `elements_0`.id) FROM `elements` `elements_0` STRAIGHT_JOIN `element_types` `element_types_0` ON (`element_types_0`.`id`=`elements_0`.`element_type_id`) STRAIGHT_JOIN `lists` `lists_0` ON (`lists_0`.`id`=`elements_0`.`list_id` AND `lists_0`.`id`=17) STRAIGHT_JOIN `neighbourhoods` `neighbourhoods_0` ON (`neighbourhoods_0`.`id`=`lists_0`.`neighbourhood_id`) STRAIGHT_JOIN `store40` `store40_0` ON (`store40_0`.`id`=`elements_0`.`attributes_store_id` AND `elements_0`.`attributes_store_type`='AttributesStore::DocumentEstimateRead') WHERE ((((((((0 | `neighbourhoods_0`.`read_rights_mask`) & (`neighbourhoods_0`.`read_rights` | ~`neighbourhoods_0`.`read_rights_mask`)) | `lists_0`.`read_rights_mask`) & (`lists_0`.`read_rights` | ~`lists_0`.`read_rights_mask`)) | `element_types_0`.`read_rights_mask`) & (`element_types_0`.`read_rights` | ~`element_types_0`.`read_rights_mask`)) | `elements_0`.`read_rights_mask`) & (`elements_0`.`read_rights` | ~`elements_0`.`read_rights_mask`)) & (4 | !ISNULL(NULL) | 2*!ISNULL(NULL)) > 0) UNION (SELECT DISTINCT COUNT(DISTINCT `elements_0`.id) FROM `elements` `elements_0` STRAIGHT_JOIN `element_types` `element_types_0` ON (`element_types_0`.`id`=`elements_0`.`element_type_id`) STRAIGHT_JOIN `lists` `lists_0` ON (`lists_0`.`id`=`elements_0`.`list_id` AND `lists_0`.`id`=17) STRAIGHT_JOIN `neighbourhoods` `neighbourhoods_0` ON (`neighbourhoods_0`.`id`=`lists_0`.`neighbourhood_id`) STRAIGHT_JOIN `store41` `store41_0` ON (`store41_0`.`id`=`elements_0`.`attributes_store_id` AND `elements_0`.`attributes_store_type`='AttributesStore::DocumentEstimateUpdate') STRAIGHT_JOIN `polyglots` `polyglots_0` ON (`polyglots_0`.`id`=`store41_0`.`attribute8_id`) STRAIGHT_JOIN `plain_texts` `plain_texts_0` ON (`polyglots_0`.`id`=`plain_texts_0`.`polyglot_id` AND `plain_texts_0`.`language`='en') WHERE ((((((((0 | `neighbourhoods_0`.`read_rights_mask`) & (`neighbourhoods_0`.`read_rights` | ~`neighbourhoods_0`.`read_rights_mask`)) | `lists_0`.`read_rights_mask`) & (`lists_0`.`read_rights` | ~`lists_0`.`read_rights_mask`)) | `element_types_0`.`read_rights_mask`) & (`element_types_0`.`read_rights` | ~`element_types_0`.`read_rights_mask`)) | `elements_0`.`read_rights_mask`) & (`elements_0`.`read_rights` | ~`elements_0`.`read_rights_mask`)) & (4 | !ISNULL(NULL) | 2*!ISNULL(NULL)) > 0)):
lib/generalized_list.rb:847:in `find'
lib/generalized_list.rb:329:in `count'
app/models/list.rb:43:in `count'
app/helpers/interface_helper.rb:139:in `list_data'
app/helpers/interface_helper.rb:53:in `neighbourhood_lists_data'
app/helpers/interface_helper.rb:49:in `map'
app/helpers/interface_helper.rb:49:in `neighbourhood_lists_data'
app/helpers/interface_helper.rb:42:in `neighbourhood_data'
app/helpers/interface_helper.rb:19:in `neighbourhood_index'
app/helpers/interface_helper.rb:18:in `map'
app/helpers/interface_helper.rb:18:in `neighbourhood_index'
app/controllers/neighbourhoods_controller.rb:15:in `index'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment