Skip to content

Instantly share code, notes, and snippets.

@jasononaquest
Created April 7, 2015 16:51
Show Gist options
  • Save jasononaquest/da3f0c8ee37ce1abecde to your computer and use it in GitHub Desktop.
Save jasononaquest/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