Skip to content

Instantly share code, notes, and snippets.

@vijaydev
Created May 20, 2011 10:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vijaydev/982669 to your computer and use it in GitHub Desktop.
Save vijaydev/982669 to your computer and use it in GitHub Desktop.
allotments = []
params[:roles_divisions].map do |rd|
rd[2].each do |d|
allotments << Allotment.create(:user_id => @user.id, :division_id => d.to_i, :role_name => rd[0])
end
end
@user.allotments = allotments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment