lanrion/qy_wechat

Unknown column 'qy_secret_key.qy_secret_key' in 'where clause': SELECT `user_apps`.* FROM `user_apps` WHERE `qy_secret_key`.`qy_secret_key` = '2222' LIMIT 1

Closed this issue · 1 comments

zqj commented

UserApp Load (0.6ms) SELECT user_apps.* FROM user_apps WHERE qy_secret_key.qy_secret_key = '2222' LIMIT 1
Mysql2::Error: Unknown column 'qy_secret_key.qy_secret_key' in 'where clause': SELECT user_apps.* FROM user_apps WHERE qy_secret_key.qy_secret_key = '2222' LIMIT 1
Completed 500 Internal Server Error in 3ms

ActiveRecord::StatementInvalid (Mysql2::Error: Unknown column 'qy_secret_key.qy_secret_key' in 'where clause': SELECT user_apps.* FROM user_apps WHERE qy_secret_key.qy_secret_key = '2222' LIMIT 1):
activerecord (4.1.8) lib/active_record/connection_adapters/abstract_mysql_adapter.rb:303:in query' activerecord (4.1.8) lib/active_record/connection_adapters/abstract_mysql_adapter.rb:303:inblock in execute'
activerecord (4.1.8) lib/active_record/connection_adapters/abstract_adapter.rb:373:in block in log' activesupport (4.1.8) lib/active_support/notifications/instrumenter.rb:20:ininstrument'
activerecord (4.1.8) lib/active_record/connection_adapters/abstract_adapter.rb:367:in log' activerecord (4.1.8) lib/active_record/connection_adapters/abstract_mysql_adapter.rb:303:inexecute'
activerecord (4.1.8) lib/active_record/connection_adapters/mysql2_adapter.rb:228:in execute' activerecord (4.1.8) lib/active_record/connection_adapters/mysql2_adapter.rb:232:inexec_query'
activerecord (4.1.8) lib/active_record/connection_adapters/mysql2_adapter.rb:240:in select' activerecord (4.1.8) lib/active_record/connection_adapters/abstract/database_statements.rb:24:inselect_all'
activerecord (4.1.8) lib/active_record/connection_adapters/abstract/query_cache.rb:68:in block in select_all' activerecord (4.1.8) lib/active_record/connection_adapters/abstract/query_cache.rb:83:incache_sql'
activerecord (4.1.8) lib/active_record/connection_adapters/abstract/query_cache.rb:68:in select_all' activerecord (4.1.8) lib/active_record/querying.rb:39:infind_by_sql'
activerecord (4.1.8) lib/active_record/relation.rb:611:in exec_queries' activerecord (4.1.8) lib/active_record/relation.rb:493:inload'
activerecord (4.1.8) lib/active_record/relation.rb:238:in to_a' activerecord (4.1.8) lib/active_record/relation/finder_methods.rb:460:infind_take'
activerecord (4.1.8) lib/active_record/relation/finder_methods.rb:98:in take' activerecord (4.1.8) lib/active_record/relation/finder_methods.rb:104:intake!'
activerecord (4.1.8) lib/active_record/relation/finder_methods.rb:87:in find_by!' activerecord (4.1.8) lib/active_record/querying.rb:7:infind_by!'
activerecord (4.1.8) lib/active_record/dynamic_matchers.rb:70:in find_by_qy_secret_key!' activerecord (4.1.8) lib/active_record/dynamic_matchers.rb:24:inmethod_missing'
/Users/zhangqinjian/.rvm/gems/ruby-2.1.4@rails418/bundler/gems/qy_wechat-a019c223bc3c/app/controllers/qy_wechat/qy_wechat_controller.rb:68:in `setup_qy_app'

find_by_qy_secret_key!(qy_secret_key: qy_secret_key)

fixed