scopes with lambda and arguments in Rails 4 style?

前端 未结 6 917
长情又很酷
长情又很酷 2020-12-04 06:34

I\'m wondering how the following is done in Rails 4 or if I just use the Rails 3 approach for using a lambda that can pass an argument the same way with 4 as I do with 3.

6条回答
  •  無奈伤痛
    2020-12-04 07:27

    Ruby has not deprecated the old style of lambda either, so if you feel more comfortable using that by all means go for it.

    I don't personally like the stabby lambda's syntax myself but eventually they will probably become the norm so it doesn't hurt to get used to them.

提交回复
热议问题