Skip to content

Instantly share code, notes, and snippets.

@maliqq
Created June 12, 2011 19:31
Show Gist options
  • Save maliqq/1021908 to your computer and use it in GitHub Desktop.
Save maliqq/1021908 to your computer and use it in GitHub Desktop.
# references_and_referenced_in_many :players, :class_name => 'User'
a.players = User.limit(5).to_a; a.save! # validation failed
a.player_ids = User.limit(5).map(&:id); a.save! # saves
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment