class Execution < ApplicationRecord belongs_to :command has_many :actions has_one :execution, ->(o){Execution.find(o.value)} def execution Execution.find(value) end end