Rollout & retrocompatibility
migration
front
back
resque
migration
front
back
resque
class Migration
def up
rename_column :acticle,
:highlight,
:title
end
end
class ArticleController
def update
Article.first.update!(
highlight: params(:highlight),
content: params(:content)
)
end
endclass ArticleController
def update
Article.first.update!(
title: params(:title),
content: params(:content)
)
end
end
class ArticleController
def update
Article.first.update!(
highlight: params(:highlight),
content: params(:content)
)
end
endclass ArticleController
def update
Article.first.update!(
title: params(:title),
highlight: params(:title),
content: params(:content)
)
end
endclass Migration
def up
rename_column :acticle,
:highlight,
:title
end
end
class ArticleController
def update
Article.first.update!(
title: params(:title),
content: params(:content)
)
end
endmigration
front
back
resque
class ArticleController
def update
Article.first.update!(
highlight: params(:highlight),
content: params(:content)
)
end
endclass ArticleController
def update
Article.first.update!(
title: params(:title),
content: params(:content)
)
end
end
put('/articles/1/', {
content: "Lalala",
title: "Title"
})class ArticleController
def update
Article.first.update!(
title: params(:title),
content: params(:content)
)
end
end
put('/articles/1/', {
content: "Lalala",
title: "Title"
})class ArticleController
def update
Article.first.update!(
title: params(:title) || params(:highlight),
content: params(:content)
)
end
endclass ArticleController
def update
Article.first.update!(
title: params(:title),
content: params(:content)
)
end
endput('/articles/1/', {
content: "Lalala",
title: "Title"
})Rollout & retrocompatibility
By Thomas Hareau
Rollout & retrocompatibility
- 695