`@merge_request = @project.merge_requests.new(params[:merge_request])`  should cover this off, the `to_i` lines should be necessary