Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
X
@xiayuanyin
Member
NO. 30935 / 2017-03-27

[email protected]
2 Topics / 16 Replies
3 Followers
1 Following
0 Favorites
No GitHub.
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 求助使用 pg 包连接 postgres 的问题 at April 24, 2022

    listen 的 127.0.0.1,外部是访问不了的,要 bind 0.0.0.0

  • 关于 Rails 6 设置 cookie same site 为 None 的问题 at April 08, 2021

    我是本地调试强行 monkey patch 绕过了

  • 已结束 at October 15, 2020

    😃 薪资感人

  • 请教,在 Linux 主机下如何知道通过网线直连的设备的 IP 地址? at September 23, 2020

    找了半天,tcpdump 似乎可以抓到 arp 通讯信息

    tcpdump -i eth0 -p arp

  • 长文慎点:部署(Docker + Ubuntu + Ruby 2.6.1 + Rails + Capistrano + Puma) at May 13, 2020

    既然用了 docker 就该放弃 capistrano 了,换换思路

  • 如何判断生产环境下 Nginx 是否正常工作 at May 13, 2020

    意思是你的 nginx 就监听了 3000 端口

  • 如何判断生产环境下 Nginx 是否正常工作 at May 11, 2020

    netstat -nltp (number, listen, tcp, programs)

  • null at April 07, 2020

    👍

  • 两个月逆境重生,成功进入某银行大数据开发外包 at March 20, 2020

    佩服佩服

  • 百万行百字段 all.each do 会挂死 at January 20, 2020

    pg 的话建议用游标 https://github.com/afair/postgresql_cursor

  • [深圳] 构建深圳真正以 Ruby 技术为核心的产品技术团队,至简天成科技招聘 Rails 全栈工程师 2~3 名 at September 10, 2019

    👍 👍 👍 好有吸引力,可惜人不在深圳

  • SimpleAPM - Rails 慢事务追踪 at March 01, 2019

    欢迎指点呐

  • rest-client 在有的服务器上返回超时 at August 08, 2018

    那就是网络问题了,域名解析,dns 检查一下,traceroute 看看

  • rest-client 在有的服务器上返回超时 at August 07, 2018

    curl 看看先

  • 删除数据时候,总是使用缓存的问题 at May 08, 2018

    DecisionLog.where("created_at < '#{31.days.ago}'").limit(100).count

  • Rails has_many 关联查询问题 at April 02, 2018

    方案一:

    has_many :projects, -> {joins('inner joins (select user_id, max(index) max_index from  projects group by user_id) grouped_projects on grouped_projects.user_id=projects.user_id and grouped_projects.max_index=projects.index')}
    

    当然也可以给 grouped_projects 存成一个 view,如果 projects 表数据多则会对数据库开销比较大

    方案二:

    给 projects 加一个字段index_max<Boolean>,然后直接加在 where 条件里;index_max 字段在数据库设置触发器自动计算或者在 rails 的 ActiveRecord 里 after_save 关联计算

关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English