Skip to content

Instantly share code, notes, and snippets.

@victorcreed
Created April 19, 2013 07:55
Show Gist options
  • Save victorcreed/5418811 to your computer and use it in GitHub Desktop.
Save victorcreed/5418811 to your computer and use it in GitHub Desktop.
dont know
%w(buy rent).each do |a|
define_method "user_#{a}_movies" do
instance_variable_get(:"@#{a}_movies").blank? ? instance_variable_set( :"@#{a}_movies", PublicActivity::Activity.where(owner_id: User.current.id, owner_type: "User", key: "video.#{a}")) : instance_variable_get(:"@#{a}_movies")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment