You could use hash
like in the following
class ArticlesController < ApplicationController
...
def update
@article = Article.find(params[:id])
orig_content_hash = @article.content.to_s.hash
if @article.update(article_params)
# hash will have changed if content was updated
send_notification unless @article.content.to_s.hash == orig_content_hash
redirect_to article_path(@article.id)
else
render :edit
end
end
...
end
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…