class Office < ActiveRecord::Base
   has_many :logins
   $active_db=Rails.configuration.database_configuration[Rails.env]["adapter"]
   def self.like_compare(object,compared,invert)
     if $active_db == "sqlserver"
       if invert == 0;sign="LIKE";else;sign="NOT LIKE";end
       result=self.where("lower(#{object}) #{sign} lower('#{compared}')")
     else
       if invert == 0;sign="=";else;sign="!=";end
       result=self.where("lower(#{object}) LIKE lower('#{compared}') #{sign} true")
     end
     return result
   end
end
