Skip to content

Commit

Permalink
Fix examples/models
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxLap committed Aug 7, 2019
1 parent 12bf9ec commit e7148c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Post < ActiveRecord::Base
belongs_to :author, class_name: "User"
has_many :comments
has_many :comments_author, through: :comments
has_one :last_comment, class_name: "Comment", order("created_at DESC")
has_one :last_comment, -> { order("created_at DESC") }, class_name: "Comment"

# Easy and powerful scope examples
scope :by_admin, -> { where_assoc_exists(:author, &:admins) }
Expand Down

0 comments on commit e7148c1

Please sign in to comment.