Skip to content

Instantly share code, notes, and snippets.

@skalnik
Created March 6, 2012 20:50
Show Gist options
  • Save skalnik/1988912 to your computer and use it in GitHub Desktop.
Save skalnik/1988912 to your computer and use it in GitHub Desktop.
class Bandcamp
attr_accessor :tags
#=> Defines:
def tags
@tags
end
def tags=(tags)
@tags = tags
end
def split_tags
@tags = []
self.tags.split(' ').map do |name|
@tags << Tag.find_or_create_by_name(name.chomp)
end
end
def save
split_tags()
# ...
end
# ...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment