Skip to content

Instantly share code, notes, and snippets.

@JasonSpatial
Created April 7, 2015 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JasonSpatial/da3f0c8ee37ce1abecde to your computer and use it in GitHub Desktop.
Save JasonSpatial/da3f0c8ee37ce1abecde to your computer and use it in GitHub Desktop.
copy_list.rb
class CopyList
class << self
def call(list, name, user)
if list.user_id = user.id
new_list = list.dup
new_list.name = name
new_list.save
new_list
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment