Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 12 lines (9 sloc) 0.521 kb
OHM源码阅读笔记;
ohm的set: # An implementation which relies on *SMEMBERS* and yields an instance
methods:
Set里面:
replace:操作是先将当前collection清空然后将新的modle 迭代add 加入
sort: 使用ruby的sort会将所有的实例载入到array里进行sort
find: Post.find is actually just a wrapper around Post.all.find
#意味着执行find时会首先将所有实例载入内存,此处加index避免
model里面除了通过id,find其他都需要定义index
Jump to Line
Something went wrong with that request. Please try again.