开发者

Different output in development than on production server?

开发者 https://www.devze.com 2023-03-18 14:33 出处:网络
I\'ve got a block of code generating different results on my development machine than on my production server. When I run the SQL that\'s generated from the named_scope, its identical, and when I run

I've got a block of code generating different results on my development machine than on my production server. When I run the SQL that's generated from the named_scope, its identical, and when I run the query directly on identical copies, it gives the correct answer.

Even if I call the method from the console in each env, it gives the same answer.

I only seem to have the problem when I'm calling it from the controller/view. I've got @end_date = @start_date to keep consistent formatting with other, similar named_scopes.

@start_date  = (Time.now)
@end_date    = @start_date
named_scope :today, {:conditions => "shipped_on >= '#{@start_date.year}-#{@start_date.month}-#{@start_date.day} 00:开发者_开发百科00:00' AND shipped_on <= '#{@end_date.year}-#{@end_date.month}-#{@end_date.day} 23:59:59'"}

Any thoughts or places I can check for inconsistencies?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号