Sha256: 90d512cf5c555262b833510c6ca6e431ee706e9ee378c6eb5dc03a2f6490ca1c

Contents?: true

Size: 214 Bytes

Versions: 2

Compression:

Stored size: 214 Bytes

Contents

class Book < ActiveRecord::Base
  belongs_to :author
  validates_presence_of :title

  scope :sorted_by_author_name, lambda { |dir| joins(:author).order("authors.last_name #{dir}, authors.first_name #{dir}") }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
netzke-basepack-0.7.4 test/basepack_test_app/app/models/book.rb
netzke-basepack-0.7.3 test/basepack_test_app/app/models/book.rb