Created
July 22, 2009 19:20
-
-
Save xxx/152205 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from /lib/active_record/fixtures.rb (code is the same in 2.3.2 and 2.3.3) | |
def parse_yaml_string(fixture_content) | |
YAML::load(erb_render(fixture_content)) | |
rescue => error | |
raise Fixture::FormatError, "a YAML error occurred parsing #{yaml_file_path}. Please note that YAML must be consistently indented using spaces. Tabs are not allowed. Please have a look at http://www.yaml.org/faq.html\nThe exact error was:\n #{error.class}: #{error}" | |
end | |
def erb_render(fixture_content) | |
ERB.new(fixture_content).result | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment