Я получил этот файл данных yml от недоступного коллеги. Мне нужно загрузить его, чтобы получить данные, но я не уверен, как:
---
- !ruby/object:Question
concise_attributes:
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: id
value_before_type_cast: 1
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: name
value_before_type_cast: Trip Summary
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: question
value_before_type_cast: Please state your general feelings about itinerary, the
group, and the operations. How did it go overall?
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: created_at
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: updated_at
new_record: false
active_record_yaml_version: 2
- !ruby/object:Question
concise_attributes:
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: id
value_before_type_cast: 2
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: name
value_before_type_cast: Itinerary
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: question
value_before_type_cast: Did you and the clients like the itinerary? If not, why
not? How could it be improved? Was it accurate? Did you make any adjustments
to the itinerary? Please describe any special things you did on the trip that
were not part of the itinerary.
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: created_at
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: updated_at
new_record: false
active_record_yaml_version: 2
Моим первым предположением было использование гема yaml_db, а затем непосредственно YAML :: load_file, но я получаю ошибку:
ArgumentError: undefined class/module Question
Несмотря на то, что в приложении есть модель Вопроса
class Question < ActiveRecord::Base
end