• 更好的做法請使用(Rails 4+):

    Qms::Branch.where.not(types: 'dashboard')
    

    一般來說更推薦用 ActiveRecord 而非手捏 SQL,有諸多好處。譬如:

    Foo.where(prop: 'a')
    Foo.where(prop: nil)
    

    會分別被自動翻譯成:

    SELECT ... FROM ... WHERE col = 'a'
    SELECT ... FROM ... WHERE col IS NULL
    

    :-)