プロジェクト

全般

プロフィール

« | » 

リビジョン eaa3da6d

高徹 高橋 徹 さんが7年以上前に追加

Fix update_all for signature change at Rails 4.0

差分を表示:

app/models/term_category.rb
# If a category is specified, terms are reassigned to this category
def destroy(reassign_to = nil)
if reassign_to && reassign_to.is_a?(TermCategory) && reassign_to.project == self.project
Term.update_all("category_id = #{reassign_to.id}", "category_id = #{id}")
Term.where(category_id: id).update_all(category_id: reassign_to.id)
end
destroy_without_reassign
end

他の形式にエクスポート: Unified diff