Skip to content

Instantly share code, notes, and snippets.

@timoschilling
Last active December 11, 2015 20:19
Show Gist options
  • Select an option

  • Save timoschilling/4654746 to your computer and use it in GitHub Desktop.

Select an option

Save timoschilling/4654746 to your computer and use it in GitHub Desktop.
class D
def macro
:referenced_in
end
def foreign_key
"listimage_asset_id"
end
def eager_load ids
ids = ids.dup
ids.compact!
ids = ids.map { |id| Vrame::AssetBase.decrop_id id }
ids.uniq!
puts ids
Asset.find ids
end
end
x = Event.limit(5)
x.inclusions << d = D.new
x.to_a; nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment