Skip to content

Instantly share code, notes, and snippets.

@indrode
Last active August 29, 2015 14:04
Show Gist options
  • Save indrode/9a7bc0048827002e691b to your computer and use it in GitHub Desktop.
Save indrode/9a7bc0048827002e691b to your computer and use it in GitHub Desktop.
Changing product streaming rights.
p = Product.find(id)
# to get the current rights string
p.tracks.first.new_track_rights.rights
# edit this string
rights = "WW99999999-99999999|ZA20140101-99999999|NG20140101-99999999"
p.tracks.each do |t|
n = t.new_track_rights
n.rights = rights
n.save
t.save
end
p.update_ati!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment