Case_sensitive_filter_for_version_name_.patch

Nastya Fedorova, 2017-10-04 15:17

Download (622 Bytes)

View differences:

app/models/version.rb (revision )
45 45
  scope :like, lambda {|arg|
46 46
    if arg.present?
47 47
      pattern = "%#{arg.to_s.strip}%"
48
      where("LOWER(#{Version.table_name}.name) LIKE :p", :p => pattern)
48
      where("LOWER(#{Version.table_name}.name) LIKE LOWER(?)", pattern)
49 49
    end
50 50
  }
51 51
  scope :open, lambda { where(:status => 'open') }