@lgn21st 哦?我是这样呢。
@lgn21st 你的 slides 页面貌似打不开
楼主下次我来送闪
可以赞
赞,期待楼主继续贡献
#5 楼 @zhzenghui 因为 user 没有 admin 方法啊,只定义了 admin? 方法
第一张照片治疗颈椎病啊
def admin?
Setting.admin_emails.include?(self.email)
end
如果 user 的 email 被登记为管理员的 email 则该用户为管理员
确实赞,印象特别深的是:“最大的竞争对手,是墙”
呵呵,有时 id 和 class 是会傻傻分不清楚的
报名了两个 workshop,还有两天啦,想想还有点小激动呐
撒花
[email protected] 对小团队还不够友好,不是都要先成立公司才用云服务的
对 X 取模,这个 X 应该不会太小,不然 81 这样的数字就不会取到,也不能太大,超过 100 那么猜的数字越大就越有几率接近模值。这样下来 X = 100 是比较好的选择,让所有两位数都有相同的几率。既然 X = 100, 到 11 月 12 号来算算大家的回复和值再猜会比较准吧。 纯属臆测,欢迎拍砖
Simple Form was designed to be customized as you need to. Basically it's a stack of components that are invoked to create a complete html input for you, which by default contains label, hints, errors and the input itself. It does not aim to create a lot of different logic from the default Rails form helpers, as they do a great job by themselves.
涨见识:thumbsup:
@hiveer 我也想过这个问题,但是我看不到 ClassMethods 中用了任何的 AllowedFormats。 这是相关的 commit,我还是觉得 ClassMethods 中的这个 extend 是多余的 https://github.com/jnunemaker/httparty/commit/d0d88fecfdd7528fa8bd8d12004f686318f3486c
a.select { |el| el.is_a? Integer }
我觉得第一个是防止别人用 HTTParty::AllowedFormats
, 第二个是防止别人用HTTParty::ClassMethods::AllowedFormats
做不出楼主那种奇怪的 SQL
2.1.1 :001 > User.where(admin: true)
User Load (1.5ms) SELECT "users".* FROM "users" WHERE "users"."admin" = 't'
=> #<ActiveRecord::Relation [#<User id: 1,
2.1.1 :002 > User.where(admin: false)
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."admin" = 'f'
=> #<ActiveRecord::Relation []>