Skip to content

Instantly share code, notes, and snippets.

@tjad
Created January 7, 2017 08:41
Show Gist options
  • Save tjad/8f67a4cd01edd2572fc5c88573763c0d to your computer and use it in GitHub Desktop.
Save tjad/8f67a4cd01edd2572fc5c88573763c0d to your computer and use it in GitHub Desktop.
class OtherModel
include ActiveNode
property :name
end
class MyModel
include ActiveNode
has_one :out, :other_model, :SOME_TYPE
end
my_model = MyModel.new
#however, this should not be calling underlying framework to handle the association, I don't want extra queries at this point
my_model.other_model = OtherModel.new(name: 'test')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment