Skip to content

Instantly share code, notes, and snippets.

@kubakrzempek
Created May 19, 2016 08:00
Show Gist options
  • Save kubakrzempek/c094565d8bb6ff4850e0d80c19b8fa62 to your computer and use it in GitHub Desktop.
Save kubakrzempek/c094565d8bb6ff4850e0d80c19b8fa62 to your computer and use it in GitHub Desktop.
facts = [
{
fact_category: {
name: "Cars",
code: "cars",
protected: false,
enabled: true,
system: true,
fact_types: [
{
code: "st",
name: "station codes",
fact_values: [],
},
],
},
}
]
create_command = WheelsApp.instance["persistence"].command.create(fact_category: :fact_categories) do |fact_category|
fact_category.create(fact_type: :fact_types) do |fact_type|
fact_type.create(:fact_values)
end
end
create_command.call(facts[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment