Sha256: 06a975e00fbdafcbd8f430b59ab96e5a1c510872fec32d5f03022e98fe9ba20a

Contents?: true

Size: 263 Bytes

Versions: 7

Compression:

Stored size: 263 Bytes

Contents

module ActiveRecord
  module FinderMethods
    def ordered_relation
      if order_values.empty? && (implicit_order_column || primary_key)
        order(arel_attribute(implicit_order_column || primary_key).asc)
      else
        self
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
activerecord-uuid-order-0.7.0 lib/activerecord-uuid-order/core_extensions.rb
activerecord-uuid-order-0.6.0 lib/activerecord-uuid-order/core_extensions.rb
activerecord-uuid-order-0.5.0 lib/activerecord-uuid-order/core_extensions.rb
activerecord-uuid-order-0.4.0 lib/activerecord-uuid-order/core_extensions.rb
activerecord-uuid-order-0.3.0 lib/activerecord-uuid-order/core_extensions.rb
activerecord-uuid-order-0.2.0 lib/activerecord-uuid-order/core_extensions.rb
activerecord-uuid-order-0.1.0 lib/activerecord-uuid-order/core_extensions.rb