where("(#{self.table_name}.id in (?)) or (#{self.table_name}.path like ?) or (#{self.table_name}.path rlike ?)",department.path.to_s.split('/').map(&:to_i),"%/#{department.id}/%","\/#{department.id}$")
acts_as_listscope: '#{parent_id.present? ? %Q{parent_id = #{parent_id}} : %q{parent_id is null}} and #{organization_id.present? ? %Q{organization_id = #{organization_id}} : %q{organization_id is null}} and deleted_at is null',add_new_at: :bottom