RailsCasts Pro episodes are now free!

Learn more or hide this

Christopher Patuzzo's Profile

GitHub User: tuzz

Site: http://chris.patuzzo.co.uk

Comments by Christopher Patuzzo

Avatar

Don't make the mistake of setting tweet_id's type to an integer. MySQL maxes out at 2147483647 unless you specify a limit. It's easier to just make it a string.

Avatar

You'll still need to split:

ruby
def tag_tokens=(ids)
  ids = ids.split(',')
  self.tag_list = Tag.where(:id => ids).map(&:name)
end
Avatar

If you're using acts-as-taggable-on and you're getting 'Validation failed: Context can't be blank', the following should work:

ruby
def tag_tokens=(ids)
  self.tag_list = Tag.where(:id => ids).map(&:name)
end