我想区分由 first_or_create 搜索或创建的。
record = MasterRecord.where(:name=>'test_data').firest_or_create
# and i want differentiate searched or created like this.
# but there is no created_record? method
if record.created_record?
render :status=>200, :json => record.to_json
else
render :status=>409, :json => record.to_json
end
我该怎么做呢?