Sha256: a64fda7cd59a85701d46c4d6998c8ae8b092ee0d9f736f5d7dee1a9f4b9a67db

Contents?: true

Size: 242 Bytes

Versions: 35

Compression:

Stored size: 242 Bytes

Contents

class User < ActiveRecord::Base
  has_many :comments

  auxiliary_statement :last_comment do |cte|
    cte.query Comment.distinct_on(:user_id).order(:user_id, id: :desc)
    cte.attributes id: :comment_id, content: :comment_content
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
torque-postgresql-3.4.1 spec/models/user.rb
torque-postgresql-2.4.5 spec/models/user.rb
torque-postgresql-3.4.0 spec/models/user.rb
torque-postgresql-3.3.3 spec/models/user.rb
torque-postgresql-2.4.4 spec/models/user.rb
torque-postgresql-3.3.2 spec/models/user.rb
torque-postgresql-2.4.3 spec/models/user.rb
torque-postgresql-3.3.1 spec/models/user.rb
torque-postgresql-3.3.0 spec/models/user.rb
torque-postgresql-3.2.2 spec/models/user.rb
torque-postgresql-2.4.2 spec/models/user.rb
torque-postgresql-2.4.1 spec/models/user.rb
torque-postgresql-3.2.1 spec/models/user.rb
torque-postgresql-2.4.0 spec/models/user.rb
torque-postgresql-3.2.0 spec/models/user.rb
torque-postgresql-3.1.0 spec/models/user.rb
torque-postgresql-2.3.0 spec/models/user.rb
torque-postgresql-3.0.1 spec/models/user.rb
torque-postgresql-2.2.4 spec/models/user.rb
torque-postgresql-3.0.0 spec/models/user.rb