From f47421f2a058a5ca845969e8d15be2028c3e6972 Mon Sep 17 00:00:00 2001 From: Eric Steele Date: Sat, 15 Mar 2014 21:49:04 -0400 Subject: Extend fixture label replacement to allow string interpolation Allows fixtures to use their $LABEL as part of a string instead of limiting use to the entire value. mark: first_name: $LABEL username: $LABEL1973 email: $LABEL@$LABELmail.com users(:mark).first_name # => mark users(:mark).username # => mark1973 users(:mark).email # => mark@markmail.com --- activerecord/test/fixtures/pirates.yml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'activerecord/test/fixtures') diff --git a/activerecord/test/fixtures/pirates.yml b/activerecord/test/fixtures/pirates.yml index 6004f390a4..1bb3bf0051 100644 --- a/activerecord/test/fixtures/pirates.yml +++ b/activerecord/test/fixtures/pirates.yml @@ -7,3 +7,6 @@ redbeard: parrot: louis created_on: "<%= 2.weeks.ago.to_s(:db) %>" updated_on: "<%= 2.weeks.ago.to_s(:db) %>" + +mark: + catchphrase: "X $LABELs the spot!" -- cgit v1.2.3