1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

to_param shoul return a string

This commit is contained in:
Piotr Sarnacki 2010-07-24 17:43:50 +02:00
parent 4cd6f77526
commit 0c1cd15470

View file

@ -83,7 +83,7 @@ class Comment
def to_key; id ? [id] : nil end
def save; @id = 1; @post_id = 1 end
def persisted?; @id.present? end
def to_param; @id; end
def to_param; @id.to_s; end
def name
@id.nil? ? "new #{self.class.name.downcase}" : "#{self.class.name.downcase} ##{@id}"
end