fixes #5132 URL doesn't update correctly after creating a new host

(cherry picked from commit 5f58478b95ffd51eb41f53718e09c03a3613c827)
fixes #5490 - ambiguous column in taxonomix pluck on Rails 3.2.8

(cherry picked from commit 3089c85f005425e8fec07c560ce5fb65ca25d45d)
fixes #5038 - remove empty label causing template edit box indentation

(cherry picked from commit a33142b9cad0f15152c6ec683d7e7372350e9acc)
fixes #5427 - skip user roles FK removal if it's missing

(cherry picked from commit 90f0a0b0b85ec589a8951b5bc0cddf7499bfc186)
Fixes #4287 - Join directly to template_combinations when resolving templates

(cherry picked from commit 1443ec139bdb0a31faeef80f6c177d4f30fa4bdb)
Fixes #4370 - Filters list show permissions

(cherry picked from commit 46da92f0cac25391c1c76599ef19edf38684b9d5)
fixes #5506 - added scoped search to SmartProxy for UI and API v2

(cherry picked from commit 428b1cfb6f6e19294756078ee70d862a36a566de)
fixes #5540 - also clone builtin roles during migration

(cherry picked from commit 5f72ef39f3bee84942d6706e2d9954d219a56ee4)
fixes #5489 - don't generate empty search () filters on permissions migration

(cherry picked from commit fec952bd2002f672a8907821169c0675d04cfbbc)