1. 27 12月, 2014 3 次提交
  2. 05 12月, 2014 1 次提交
  3. 30 10月, 2014 1 次提交
  4. 29 10月, 2014 1 次提交
    • X
      let's warn with heredocs · b3bfa361
      Xavier Noria 提交于
      The current style for warning messages without newlines uses
      concatenation of string literals with manual trailing spaces
      where needed.
      
      Heredocs have better readability, and with `squish` we can still
      produce a single line.
      
      This is a similar use case to the one that motivated defining
      `strip_heredoc`, heredocs are super clean.
      b3bfa361
  5. 07 9月, 2014 1 次提交
    • C
      Fix query with nested array in Active Record · 72d1663b
      Cristian Bica 提交于
      `User.where(id: [[1,2],3])` was equal to `User.where(id:[1, 2, 3])`
      in Rails 4.1.x but because of some refactoring in Arel this stopped
      working in 4.2.0. This fixes it in Rails.
      
      [Dan Olson & Cristian Bica]
      72d1663b
  6. 27 5月, 2014 2 次提交
  7. 29 7月, 2013 1 次提交
    • S
      Add ability to specify how a class is converted to Arel predicate · 92a60338
      sgrif 提交于
      This adds the ability for rails apps or gems to have granular control
      over how a domain object is converted to sql. One simple use case would
      be to add support for Regexp. Another simple case would be something
      like the following:
      
          class DateRange < Struct.new(:start, :end)
            def include?(date)
              (start..end).cover?(date)
            end
          end
      
          class DateRangePredicate
            def call(attribute, range)
              attribute.in(range.start..range.end)
            end
          end
      
          ActiveRecord::PredicateBuilder.register_handler(DateRange,
            DateRangePredicate.new)
      
      More complex cases might include taking a currency object and converting
      it from EUR to USD before performing the query.
      
      By moving the existing handlers to this format, we were also able to
      nicely refactor a rather nasty method in PredicateBuilder.
      92a60338