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-2.2.3 spec/models/user.rb
torque-postgresql-2.2.2 spec/models/user.rb
torque-postgresql-2.2.1 spec/models/user.rb
torque-postgresql-2.2.0 spec/models/user.rb
torque-postgresql-2.1.3 spec/models/user.rb
torque-postgresql-2.1.2 spec/models/user.rb
torque-postgresql-2.1.1 spec/models/user.rb
torque-postgresql-2.1.0 spec/models/user.rb
torque-postgresql-2.0.6 spec/models/user.rb
torque-postgresql-2.0.5 spec/models/user.rb
torque-postgresql-2.0.4 spec/models/user.rb
torque-postgresql-2.0.3 spec/models/user.rb
torque-postgresql-2.0.2 spec/models/user.rb
torque-postgresql-2.0.1 spec/models/user.rb
torque-postgresql-2.0.0 spec/models/user.rb