下面的代碼來自評論控制器。第3行中的「哦」是什麼?什麼是軌道2.3中的「哦」方法?
@offer = Offer.find(params[:offer_id])
@offer_comment = @offer.offer_comments.build(params[:offer_comment])
@offer_comment.commenter oh = current_user
@offer_comment.save!
Notify::offer_comment_create(@offer_comment)
@offer.update_attribute(:read, false) if @offer.read? and current_user == @offer.offerer
爲什麼它被拒絕?誰是仇敵:(。 – geekdeepak 2013-04-25 19:22:38
我的猜測是他們認爲你可能已經想出了這個問題。對於近距離投票也許也是如此。我不同意,因爲如果你不是一個有經驗的Ruby開發者,你可能不會理解'oh = current_user'。我認爲代碼編寫非常糟糕,你對此的反應只能證明他們通過不使用括號而產生了維護問題,特別是因爲他們沒有一致地使用它們,這些傻瓜所以不要感覺不好,這是一個糟糕的例子,如何編寫Ruby代碼 – 2013-04-26 00:43:25