我最近更新了我的宝石后,我的capistrano设置有一些问题.我有一个多阶段设置,包括生产和分段设置.
/config/deploy.rb
# setup multistage
set :stages, %w(testing production)
set :default_stage, "testing"
require 'capistrano/ext/multistage'
Run Code Online (Sandbox Code Playgroud)
/config/deploy/production.rb
# Set deploy path
set :deploy_to, "/var/www/mysite/live"
set :rails_env, "production"
Run Code Online (Sandbox Code Playgroud)
/config/deploy/testing.rb
# Set deploy path
set :deploy_to, "/var/www/mysite/test"
set :rails_env, "test"
Run Code Online (Sandbox Code Playgroud)
问题是它似乎忽略了我的deploy_to设置.它只是部署到默认的/ u/apps/mysite.
我不知道它是否有任何相关性,所有这一切的原因都是从apache + passenger到nginx + unicorn的转变.我不认为它与此有任何关系,因为这只是结帐过程.
在限制结果和包括相关模型时,我遇到了Sequelize的问题.
以下产生正确的结果,限制为10并正确排序.
Visit.findAll({
limit: 10,
order: 'updatedAt DESC',
}).success(function(visits) {
res.jsonp(visits);
}).failure(function(err) {
res.jsonp(err);
})
Run Code Online (Sandbox Code Playgroud)
SQL
SELECT * FROM `Visits` ORDER BY updatedAt DESC LIMIT 10;
Run Code Online (Sandbox Code Playgroud)
但是当我添加一个关联时,它突然限制了子查询,因此排序从未发生,因为结果集有限.
Visit.findAll({
limit: 10,
order: 'updatedAt DESC',
include: [
{ model: Account, required: true }
]
}).success(function(visits) {
res.jsonp(visits);
}).failure(function(err) {
res.jsonp(err);
})
Run Code Online (Sandbox Code Playgroud)
SQL
SELECT
`Visits`.*
FROM
(SELECT
`Visits`.*, `Account`.`id` AS `Account.id`, `Account`.`email` AS `Account.email`, `Account`.`password` AS `Account.password`, `Account`.`role` AS `Account.role`, `Account`.`active` AS `Account.active`, `Account`.`createdAt` AS `Account.createdAt`, `Account`.`updatedAt` AS `Account.updatedAt`, `Account`.`practice_id` AS `Account.practice_id`
FROM …Run Code Online (Sandbox Code Playgroud)