edition.rb
来自「本书源码对于学习RUBY网络编程语言非常有帮助。」· RB 代码 · 共 25 行
RB
25 行
class Edition < ActiveRecord::Base has_and_belongs_to_many :works has_many :orders belongs_to :publisher def Edition.of_works(works) works.map {|work| work.editions }.flatten.uniq end def composers works.map {|work| work.composer }.uniq end# The edition might have a title of its own. If not,# fall back on the title of the first (and perhaps only)# work in the edition. def nice_title (title || works[0].nice_title) + " (#{publisher.name}, #{year})" endend
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?