rename lambda references to use shorthand syntax
This commit is contained in:
@@ -6,8 +6,8 @@ class ArtistCommentary < ApplicationRecord
|
||||
before_validation :trim_whitespace
|
||||
validates_uniqueness_of :post_id
|
||||
belongs_to :post, required: true
|
||||
has_many :versions, lambda {order("artist_commentary_versions.id ASC")}, :class_name => "ArtistCommentaryVersion", :dependent => :destroy, :foreign_key => :post_id, :primary_key => :post_id
|
||||
has_one :previous_version, lambda {order(id: :desc)}, :class_name => "ArtistCommentaryVersion", :foreign_key => :post_id, :primary_key => :post_id
|
||||
has_many :versions, -> {order("artist_commentary_versions.id ASC")}, :class_name => "ArtistCommentaryVersion", :dependent => :destroy, :foreign_key => :post_id, :primary_key => :post_id
|
||||
has_one :previous_version, -> {order(id: :desc)}, :class_name => "ArtistCommentaryVersion", :foreign_key => :post_id, :primary_key => :post_id
|
||||
after_save :create_version
|
||||
after_commit :tag_post
|
||||
|
||||
|
||||
Reference in New Issue
Block a user