<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>yangxing_star (杨兴)</title>
    <link>https://ruby-china.org/yangxing_star</link>
    <description>ruby,erlang</description>
    <language>en-us</language>
    <item>
      <title>请问下是否有开源的外卖小程序平台比较好用，类美团的多商户系统</title>
      <description>&lt;p&gt;想自己做一个外卖平台小项目，基于开源项目改造，语言不限
做好是有管理后台的，类美团的多商户系统&lt;img title=":pray:" alt="🙏" src="https://twemoji.ruby-china.com/2/svg/1f64f.svg" class="twemoji"&gt; &lt;img title=":pray:" alt="🙏" src="https://twemoji.ruby-china.com/2/svg/1f64f.svg" class="twemoji"&gt; &lt;/p&gt;</description>
      <author>yangxing_star</author>
      <pubDate>Sat, 06 Dec 2025 21:05:21 +0800</pubDate>
      <link>https://ruby-china.org/topics/44409</link>
      <guid>https://ruby-china.org/topics/44409</guid>
    </item>
    <item>
      <title>Redis 删除 key 后，内存何时回收？</title>
      <description>&lt;p&gt;通过命令批量删除 redis key 后，内存一直维持不变&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;redis-cli -h 127.0.0.1  -a 123456 KEYS 'test:*'|xargs redis-cli -h 127.0.0.1 -a 123456 DEL
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;内存何时回收？&lt;/p&gt;</description>
      <author>yangxing_star</author>
      <pubDate>Tue, 30 May 2017 08:07:29 +0800</pubDate>
      <link>https://ruby-china.org/topics/33096</link>
      <guid>https://ruby-china.org/topics/33096</guid>
    </item>
    <item>
      <title>Rails ActiveRecord 如何获取 Mysql column comment?</title>
      <description>&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="no"&gt;User&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;columns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
  &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;name&lt;/span&gt;
  &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;type&lt;/span&gt;
  &lt;span class="o"&gt;...&lt;/span&gt;
  &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;是否能够通过 ActiveRecord 对象获取字段的备注？&lt;/p&gt;</description>
      <author>yangxing_star</author>
      <pubDate>Thu, 16 Jul 2015 19:44:01 +0800</pubDate>
      <link>https://ruby-china.org/topics/26528</link>
      <guid>https://ruby-china.org/topics/26528</guid>
    </item>
    <item>
      <title>Grape ActiveRecord::RuntimeRegistry.sql_runtime sql 运行时间 累加问题</title>
      <description>&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;before&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;RuntimeRegistry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sql_runtime&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="n"&gt;after&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="n"&gt;db_runtime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;RuntimeRegistry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sql_runtime&lt;/span&gt;
    &lt;span class="no"&gt;Rails&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"... ActiveRecord: &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;db_runtime&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;ms"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;db_runtime 时间总是上次执行的时间加上当前运行的时间，如何可以获取到当前一个请求的 db_runtime?&lt;/p&gt;</description>
      <author>yangxing_star</author>
      <pubDate>Sun, 05 Jul 2015 16:18:43 +0800</pubDate>
      <link>https://ruby-china.org/topics/26331</link>
      <guid>https://ruby-china.org/topics/26331</guid>
    </item>
    <item>
      <title>Grape response body 如何打印？</title>
      <description>&lt;p&gt;grape 中如何在响应后打印响应的数据？
请求的参数可以打印出来：&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;before do
  puts request.params
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;响应的数据如何打印？&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;after do
  puts ???
end
&lt;/code&gt;&lt;/pre&gt;</description>
      <author>yangxing_star</author>
      <pubDate>Sat, 28 Mar 2015 21:59:23 +0800</pubDate>
      <link>https://ruby-china.org/topics/24886</link>
      <guid>https://ruby-china.org/topics/24886</guid>
    </item>
    <item>
      <title>想购买 rubymotion， 问下有学生证是否便宜点？</title>
      <description>&lt;p&gt;@各位大神&lt;/p&gt;</description>
      <author>yangxing_star</author>
      <pubDate>Fri, 31 Oct 2014 12:39:00 +0800</pubDate>
      <link>https://ruby-china.org/topics/22378</link>
      <guid>https://ruby-china.org/topics/22378</guid>
    </item>
    <item>
      <title>Rails 4 指定第二个数据库，如何执行 migration?</title>
      <description>&lt;h2 id="配置如下"&gt;配置如下&lt;/h2&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;default: &amp;amp;default
  adapter: mysql2
  encoding: utf8
  reconnect: false
  pool: 5
  username: root
  host: remote_ip
  port: 3306

development:
  &amp;lt;&amp;lt;: *default
  database: test

# 本地数据库
test2:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: test2
  pool: 5
  username: root
  password: 
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;创建数据库：rake db:create RAILS_ENV=market&lt;/li&gt;
&lt;li&gt;表迁移：rake db:migrate SRCDIR=test2_db/migrate/ RAILS_ENV=test2
第二步出现以下问题，记得在 rails3 里面这样做是可以的
```
config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;development - set it to false&lt;/li&gt;
&lt;li&gt;test - set it to false (unless you use a tool that preloads your test environment)&lt;/li&gt;
&lt;li&gt;production - set it to true
```&lt;/li&gt;
&lt;/ul&gt;</description>
      <author>yangxing_star</author>
      <pubDate>Thu, 14 Aug 2014 10:42:18 +0800</pubDate>
      <link>https://ruby-china.org/topics/21017</link>
      <guid>https://ruby-china.org/topics/21017</guid>
    </item>
    <item>
      <title>ruby 时间区间判断</title>
      <description>&lt;p&gt;这样判断当前时间在某个区间里貌似不行，各位有木有好的办法啊？&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;days&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ago&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;days&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_now&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;include?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;Time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;</description>
      <author>yangxing_star</author>
      <pubDate>Sat, 30 Nov 2013 15:29:52 +0800</pubDate>
      <link>https://ruby-china.org/topics/15905</link>
      <guid>https://ruby-china.org/topics/15905</guid>
    </item>
    <item>
      <title>活着的意义</title>
      <description>&lt;p&gt;如果世上没有美酒，男人还有什么活头？如果男人不恋美色，女人还有什么盼头？如果婚姻只为生育，日子还有什么过头？如果男女都很安分，作家还有什么写头？如果文学不写酒色，作品还有什么看头？如果男人不迷酒色，哪个愿意去吃苦头？如果酒色都不心动，生命岂不走到尽头？—— 莫言《酒色赋》&lt;/p&gt;</description>
      <author>yangxing_star</author>
      <pubDate>Wed, 20 Nov 2013 19:59:43 +0800</pubDate>
      <link>https://ruby-china.org/topics/15681</link>
      <guid>https://ruby-china.org/topics/15681</guid>
    </item>
    <item>
      <title>mongoid 模糊匹配</title>
      <description>&lt;p&gt;User.where(nickname: /ta/).first 这样可以查出 nickname 为 star 的用户，
但是参数是一个字符串 User.where(nickname: /“ta”/).first 这样是查不出来的，有没有办法啊？&lt;/p&gt;</description>
      <author>yangxing_star</author>
      <pubDate>Mon, 21 Oct 2013 20:54:08 +0800</pubDate>
      <link>https://ruby-china.org/topics/14921</link>
      <guid>https://ruby-china.org/topics/14921</guid>
    </item>
    <item>
      <title>jruby 用什么容器部署比较好？</title>
      <description>&lt;p&gt;jruby 项目用什么容器部署比较好，求各位大神指教~...&lt;/p&gt;</description>
      <author>yangxing_star</author>
      <pubDate>Wed, 28 Aug 2013 15:12:10 +0800</pubDate>
      <link>https://ruby-china.org/topics/13695</link>
      <guid>https://ruby-china.org/topics/13695</guid>
    </item>
    <item>
      <title>js 如何判断浏览器是关闭还是刷新？</title>
      <description>&lt;p&gt;我想判断浏览器是关闭还是刷新，在网上找的方法发现都不行，
window.onbeforeunload = function(){
   //刷新和关闭都会进入到这里面...
}
各位大神求解？&lt;/p&gt;</description>
      <author>yangxing_star</author>
      <pubDate>Wed, 31 Jul 2013 18:02:11 +0800</pubDate>
      <link>https://ruby-china.org/topics/12949</link>
      <guid>https://ruby-china.org/topics/12949</guid>
    </item>
  </channel>
</rss>
