Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
Rumble Huang
@khiav223577
Member
NO. 30098 / 2017-01-09

2 Topics / 10 Replies
0 Followers
0 Following
4 Favorites
GitHub Public Repos
  • deep_pluck 457

    Allow you to pluck attributes from nested associations without loading a bunch of records.

  • pluck_all 103

    A more efficient way to get data from database. Like #pluck method but return array of hashes ins...

  • rails_or 94

    Cleaner syntax for writing OR Query in Rails 5, 6. And also add #or support to Rails 3 and 4.

  • active_model_cachers 63

    Simply cache whatever you want by using cachers which will help you maintain cached objects and e...

  • find_with_order 37

    Provides a simple way to find records in the same order of input array. Has better performance th...

  • atomically 27

    An ActiveRecord extension for writing commonly useful atomic SQL statements to avoid race condition.

  • multi_range 19

    Allow you to manipulate a group of ranges. Such as merging overlapping ranges, doing ranges union...

  • left_joins 7

    Backport left_joins method from Rails 5 for Rails 3 and 4

  • case_register 6

    Provide a design pattern to manage switch statements by mapping each case to a method which is dy...

  • texture_packer 2

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 为这个世界操碎了心 at May 06, 2021

    真正有实力的人,不会拘泥于程式语言。有时间怪东怪西,不如去补强自己吧

  • Ruby 值得一学 at May 03, 2021

    之前有阵子因缘际会摸了点 laravel,也觉得根本一样,该改名为 php on rails 才对

  • 使用 2.7.1 后性能和内存消耗都变差了 at September 22, 2020

    没感觉,你是跟哪一版的比?

  • 问一问大家,二次开发 Redmine 系统,有什么开发工具推荐吗?(Windows) at June 20, 2020

    用 WSL 在 window 上开发多年了,效能高,爽度远大于在 mac 上开发。

  • Rails 4.2.10 -> 5.0.0 的一个跟 enum 有关很隐蔽的差异 at February 16, 2020

    请问有变数的作法吗? 还是只能够这样子:

    User.first.send(:"#{column_name}_before_type_cast")
    
  • includes 的实现原理与困境 at August 17, 2018

    要优化性能的话,何不先改用 pluck 方法

  • 已知一个 gem, 如何搜索使用了这个 gem 的开源项目 at July 11, 2018

    github insights 內能看 https://github.com/alexreisner/geocoder/network/dependents

  • [分享] 更方便在 Rails 内写 OR 语句的 gem at January 17, 2017

    关于直接写 SQL 是否比较好看,每个人观感都不一
    我的确"考虑的有点简单",or 这方法也是 Rails 5 才新加的功能
    只希望这个小工具能给还身在 Rails 3, Rails 4 的人多几项选择啰!

    要写

    Person.where(name: 'Pearl').or(Person.where(age: 24))
    

    还是

    Person.where(name: 'Pearl').or(age: 24)
    

    或是

    Person.where('name = ? OR age = ?', 'Pearl', 24)
    

    就看个人抉择呗,各語法都支援的

  • [分享] 更方便在 Rails 内写 OR 语句的 gem at January 17, 2017

    简单不就是一件好事么?
    其实就是个语法糖,举例来说:
    Rails 5:

    xxx = Model.join(yyy)
    result = xxx.where(zzz).or(xxx.where(aaa)).or(xxx.where(bbb))
    

    rails_or:

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